我有一个UIDocumentInteractionController
实例(我的课上有很强的参考,我知道它的内存问题),我想发送一个照片文件到Instagram。UIDocumentInteractionController无法打开应用程序(didEndSendingToApplication:从未调用过)
我使用ig
扩展名(也尝试了igo
)保存了该文件,并且我正在呈现控制器。 Instagram显示在列表中。我点击Instagram,没有任何反应。
NSURL *imageFile = [NSURL fileURLWithPath:path];
interactionController = [UIDocumentInteractionController interactionControllerWithURL:imageFile];
interactionController.UTI = @"com.instagram.photo";
interactionController.annotation = [NSDictionary dictionaryWithObject:@"my caption" forKey:@"InstagramCaption"];
interactionController.delegate = self;
[interactionController presentOpenInMenuFromRect:self.view.frame inView:self.view animated:YES];
为了进一步调查,我已经把我的调用类的委托并实现了willBeginSendingToApplication:
和didEndSendingToApplication:
方法。有趣的是,我意识到willBeginSendingToApplication:
确实被调用,但didEndSendingToApplication:
没有。我试着更改我的文件扩展名,将UTI更改为com.instagram.exclusivegram
,检查文件的URL是否正确等,但没有一个似乎工作。没有错误,控制台或任何东西都没有。交互控制器关闭,我的应用程序继续工作,因为它以前工作,只是没有任何反应。我读过iOS 6上可能会出现一些问题,但我的应用程序是iOS 6应用程序,所以我无法在iOS上测试它6.唯一接近我发现的问题是UIDocumentInteractionController, No File Extension but UTI但它过多地陷入低级别位,我也没有非ARC代码。
问题的原因是什么?
您是否尝试在物理设备上测试?模拟器不适用于我,但是在物理设备上进行测试很有效。 – 2015-02-25 17:41:15