【问题标题】:UIDocumentInteractionController not transferring to target applicationUIDocumentInteractionController 未传输到目标应用程序
【发布时间】: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];
}

想法?

【问题讨论】:

标签: objective-c cocoa-touch ios5


【解决方案1】:

UIDocumentsInteractionController shows iBooks but doesn't open it 有使用 arc 的应用程序的正确答案。 UIDocumentInteractionController 必须是该类的属性。

还有!!!
如果您支持到 ios5,请确保您保存的图像是“.igo”类型(不是 .jpg 或 .png)。
IOS6 会在 instagram 中打开它,但低于 6 的 IOS 会直接关闭 UIDocumentInteractionController 而不会进入 instagram。

【讨论】:

  • 我在使用 7.1 SDK 打开 iOS 6 上的任何应用的所有扩展程序中都出现了这种行为
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-05-06
  • 2013-01-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多