【发布时间】:2012-03-31 03:18:28
【问题描述】:
我的应用正在生成一张图片,我尝试使用文档交互控制器和their hook 将其传递给 Instagram。哦,这是使用iOS 5.1。
我的 UIDocumentInteraction 操作表正确显示,但问题是,一旦用户选择“在 Instagram 中打开”,该表就会被关闭并且什么也没有发生。
代码:
// 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];
}
想法?
【问题讨论】:
-
想通了,原来这是stackoverflow.com/questions/9792228/…的副本
标签: objective-c cocoa-touch ios5