chr*_*rge 10 iphone objective-c ios uiactivityviewcontroller
我已经在这里和这里查看了相关的问题,并且我已经实现了建议的答案但无济于事.
我在UIToolbar上有一个UIBarButtonItem,发送操作的连接到btnTBAction_touch:
在ViewController的类头中,我有:
@property (nonatomic, strong) UIActivityViewController *activityViewController;
Run Code Online (Sandbox Code Playgroud)
类实现中的相关方法:
- (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];
}
Run Code Online (Sandbox Code Playgroud)
当我触摸调用上述方法的按钮时,在物理设备上以调试模式运行时,我在调试控制台中获得以下内容
2014-09-19 09:43:31.635 TestApp[1878:237873] LaunchServices: invalidationHandler called
2014-09-19 09:43:31.644 TestApp[1878:237814] LaunchServices: invalidationHandler called
Run Code Online (Sandbox Code Playgroud)
但是,与相关问题不同,我的应用程序在发生这种情况时不会崩溃,应用程序继续正常运行并且UIActivityViewController正确显示...但我宁愿修复错误而不是说它已经足够好了.
另外,我尝试使用以下方法对上述方法进行了一些排列:
presentationController.sourceView = self.view;
presentationController.sourceRect = self.view.frame;
Run Code Online (Sandbox Code Playgroud)
这些都没有帮助解决问题.
如果您的开发目标设备是iPhone,则不必担心此消息.看起来这是Apple的一个错误.查看开发人员论坛:"该日志消息并不表示您有任何错误."
请参阅:https://devforums.apple.com/message/1049415#1049415(可能需要您登录)
| 归档时间: |
|
| 查看次数: |
6751 次 |
| 最近记录: |