アプリからInstagramを開くことができません。これが私が使用しているコードです:
NSString *imageToUpload = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/mapapic-instagram.igo"];
NSData *imageData = UIImageJPEGRepresentation(image, 0.8);
[imageData writeToFile:imageToUpload atomically:YES];
_documentInteractionController
= [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:imageToUpload]];
_documentInteractionController.delegate = self;
_documentInteractionController.UTI = @"com.instagram.exclusivegram";
NSString *defaultInstagramText = @"Hello";
_documentInteractionController.annotation = @{ @"InstagramCaption" : defaultInstagramText };
BOOL success = [_documentInteractionController presentOpenInMenuFromRect:CGRectZero
inView:self.view.window
animated:YES];
最後の呼び出しはYESを返します。それでも何も起こらず、Instagramは開かれていません。UIDocumentInteractionControllerDelegate
メソッドは呼び出されません。Instagramアプリをインストールしています。私は何が間違っているのですか?