iOS 9 + Xcode 7.3中,通过WhatsApp分享字符串和图片时出现错误。在iOS 8中可以正常工作。代码:
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
NSArray *excludeActivities = @[UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypeAirDrop];
activityController.excludedActivityTypes = excludeActivities;
[activityController setValue:[NSString stringWithFormat:@"Test msg"] forKey:@"subject"];
[self presentViewController:activityController animated:YES completion:nil];