本文介绍了目前UIActivityViewController- LaunchServices:invalidationHandler被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我已经查看了相关问题此处和这里,我已实施了建议的答案无济于事。I've already looked at related questions here and here, and I have implemented the suggested answers to no avail.我在UIToolbar上有一个UIBarButtonItem,发送动作的连接到btnTBAction_touch:I have a UIBarButtonItem on a UIToolbar, with Connection for Send Action to btnTBAction_touch:在ViewController的类头中,我有:In the ViewController's class header I have:@property (nonatomic, strong) UIActivityViewController *activityViewController;类实现中的相关方法:- (IBAction)btnTBAction_touch:(id)sender { NSString *string = @"Some string"; NSURL *url = [[NSURL alloc] initWithString:@"http://www.google.com"]; UIImage *image = [UIImage imageNamed:@"default.png"]; self.activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[string, url, image] applicationActivities:nil]; if ([self.activityViewController respondsToSelector:@selector(popoverPresentationController)]) { UIPopoverPresentationController *presentationController = [self.activityViewController popoverPresentationController]; presentationController.sourceView = sender; } [self presentViewController:self.activityViewController animated:YES completion:nil];}当我触摸调用的按钮时,在物理设备上以调试模式运行上面的方法,我在调试控制台中得到以下内容While running in debug mode on a physical device when I touch the button that calls the above method, I get the following in the debug console2014-09-19 09:43:31.635 TestApp[1878:237873] LaunchServices: invalidationHandler called2014-09-19 09:43:31.644 TestApp[1878:237814] LaunchServices: invalidationHandler called然而,与相关问题不同,我的应用程序在发生这种情况时不会崩溃,应用程序继续正常工作并且UIActivityViewController正确显示...但我宁愿修复bug而不是说它是足够好。However, unlike the related questions my app does not crash when this happens, the app continues to work fine and the UIActivityViewController is presented correctly... but I'd rather fix the bug than say it's good enough.此外,我尝试使用以下几行对上述方法进行了一些排列:Additionally I have tried a few permutations of the above method using these lines:presentationController.sourceView = self.view;presentationController.sourceRect = self.view.frame;这些都没有帮助解决问题。None of which helped resolve the issue. 我正在使用Xcode v6.0.1 我的应用程序的部署目标仅适用于iPhone 7.0 测试运行iOS 8.0的iPhone 5s 代码全部在Objective-C I'm using Xcode v6.0.1My App's Deployment Target is 7.0 for iPhone onlyTesting on an iPhone 5s running iOS 8.0Code is all in Objective-C推荐答案如果您的开发目标设备是iPhone,则不必担心此消息。看起来这是Apple的一个错误。查看开发者论坛:该日志消息并不表示您有任何错误。If your development target target device is iPhone you should not worry about this message. It looks like it's a bug from Apple. Looking at the developer forums: "That log message does not indicate any error on your part."请参阅: https://devforums.apple.com/message/1049415#1049415 (可能要求您登录)See: https://devforums.apple.com/message/1049415#1049415 (might require you to login) 这篇关于目前UIActivityViewController- LaunchServices:invalidationHandler被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-30 01:25