我目前正在使用Xcode 6(Beta 6)测试我的应用程序.UIActivityViewController可与iPhone设备和模拟器配合使用,但与iPad模拟器和设备(iOS 8)崩溃并带有以下日志
Terminating app due to uncaught exception 'NSGenericException',
reason: 'UIPopoverPresentationController
(<_UIAlertControllerActionSheetRegularPresentationController: 0x7fc7a874bd90>)
should have a non-nil sourceView or barButtonItem set before the presentation occurs.
Run Code Online (Sandbox Code Playgroud)
我正在为iOS 7和iOS 8使用以下iPhone和iPad代码
NSData *myData = [NSData dataWithContentsOfFile:_filename];
NSArray *activityItems = [NSArray arrayWithObjects:myData, nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:nil applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeCopyToPasteboard];
[self presentViewController:activityViewController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
我也得到了一个类似的崩溃我的其他应用程序.你能指导我吗?iOS 8中的UIActivityViewController有什么变化吗?我查了但是我没有找到任何关于此的内容
使用UIDocumentMenuViewController时出现Autolayout错误,初始化DocumentMenu时出现错误,这是我的代码:
let importMenu = UIDocumentMenuViewController(documentTypes: doctypes, inMode: .Import) //Error message here
importMenu.delegate = self
importMenu.popoverPresentationController?.barButtonItem = self.addButon;
self.presentViewController(importMenu, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
这是错误,与UICollectionViewFlowLayout有关
the behavior of the UICollectionViewFlowLayout is not defined because:
2016-02-17 13:28:44.538 App[35218:1131869] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
2016-02-17 13:28:44.538 App[35218:1131869] The relevant UICollectionViewFlowLayout instance is <_UIAlertControllerCollectionViewFlowLayout: 0x7fbcd5d18e90>, and it is attached to <UICollectionView: 0x7fbcd6823000; …Run Code Online (Sandbox Code Playgroud)