2012-03-31 8 views
0

Meine App generiert ein Bild, das ich mit einem Dokument-Interaktions-Controller und their hook an Instagram übergibt. Oh, das ist iOS 5.1.UIDocumentInteractionController wird nicht in Zielanwendung übertragen

Ich habe die UIDocumentInteraction Aktion Blatt richtig angezeigt, aber das Problem ist, dass, wenn der Benutzer wählen Sie "In Instagram öffnen" das Blatt wird geschlossen und nichts passiert.

Der Code:

// Method returns a path to the generated image 
NSURL *finalCompositePath = [NSURL fileURLWithPath:[self generateFinalImage:@"instagram"]]; 
UIDocumentInteractionController *documentInteractionController; 
NSURL *instagramURL = [NSURL URLWithString:@"instagram://camera"]; 
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { 
    //imageToUpload is a file path with .ig file extension 
    documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:finalCompositePath]; 
    documentInteractionController.UTI = @"com.instagram.exclusivegram"; 
    documentInteractionController.delegate = self; 
    documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"Caption Test" forKey:@"InstagramCaption"]; 
    [documentInteractionController presentOptionsMenuFromBarButtonItem:self.ShareButton animated:YES]; 
} 

Gedanken?

+0

Es stellte sich heraus, dass dies ein Duplikat von http://stackoverflow.com/questions/9792228/uidocumentsinteractioncontroller-shows-ibooks-but-doesnt-open-it – bretto

Antwort

3

UIDocumentsInteractionController shows iBooks but doesn't open it hat die richtige Antwort für Anwendungen mit Arc. UIDocumentInteractionController muss eine Eigenschaft der Klasse sein.

ABER AUCH !!!
Wenn Sie bis zu iOS5 unterstützen, stellen Sie sicher, dass das von Ihnen gespeicherte Bild vom Typ ".igo" ist (nicht .jpg oder .png).
IOS6 öffnet es in Instagram, aber IOS weniger als 6 wird nur den UIDocumentInteractionController entlassen, ohne zu Instagram zu gehen.

+0

Ich bekomme dieses Verhalten mit allen Erweiterungen um mit dem 7.1 SDK eine App auf iOS 6 zu öffnen – cynistersix

Verwandte Themen