Possible Duplicate:
UIDocumentInteractionController no longer works in iOS6
I can't open Instagram from my app. Here's the code I'm using:
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];
The last call returns YES. Yet nothing happens, and Instagram is not opened. The UIDocumentInteractionControllerDelegate
methods are not called. I have the Instagram app installed. What am I doing wrong?