我目前正在使用XCode 6(Beta 6)testing我的应用程序。 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.' 我在iPhone 7和iOS 8上都使用以下代码 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 […]