在我使用SLComposeViewController打开Twitter或Facebook共享表的时候,在日志中看到了这条错误消息,尽管不一致。我没有使用任何新的iOS 8 API,只是在Cocoa 8上测试现有的代码。我看到其他人在使用Cocoa的其他模态视图控制器时也遇到了这个问题,甚至看到过崩溃。
LaunchServices: invalidationHandler调用
SLComposeViewController和UIActivityViewController在iOS 8中是否有新的预防措施?还有什么要考虑的吗?
发布于 2014-09-18 01:00:33
在呈现活动视图控制器后添加以下代码:
if ([activityVC respondsToSelector:@selector(popoverPresentationController)])
{
// iOS 8+
UIPopoverPresentationController *presentationController = [activityVC popoverPresentationController];
presentationController.sourceView = sender; // if button or change to self.view.
}发布于 2014-10-04 04:24:44
查看开发者论坛:“日志消息并不表示您有任何错误。”
发布于 2014-10-22 19:21:28
我对UIDocumentInteractionController也有类似的问题,当我点击外部关闭它,或者选择另一个应用程序打开文档时,它会与"LaunchServices: invalideationHandler调用“控制台消息崩溃两次(仅使用iOS 8)。
解决方法是将对presentOpenInMenuFromRect:inView:animated的调用添加到主队列中,即
dispatch_async(dispatch_get_main_queue(), ^() {
[self.documentInteraction presentOpenInMenuFromRect:theRect inView:self.view animated:YES];
});https://stackoverflow.com/questions/25759380
复制相似问题