UIActivityViewController

UIActivityViewController

UIActivityViewController 中保存笔记的情况下,用于共享内容的 ios9 无法按预期工作。这是我的一段代码:

title,description,url are contains different contents to share.//

NSArray *dataToShare= @[title,description,url];
    UIActivityViewController* activityViewController =
    [[UIActivityViewController alloc] initWithActivityItems:dataToShare
                                      applicationActivities:nil];
    [self presentViewController:activityViewController animated:YES completion:^{}];

非常感谢您提前提供任何意见。

最佳答案

我通过将不同的字符串连接为一个以将所有内容保存在 NOTES 中解决了这个问题。

NSString *url=@"http://itunes.apple.com/us/app/APPNAME/idXXXXXXXXX";
NSString * title =[NSString stringWithFormat:@"Download ECG app %@ and get free reward points!",url];
NSArray* dataToShare = @[title];
UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:^{}];

关于objective-c - UIActivityViewController 在 ios9 中共享任何内容,在保存笔记的情况下无法按预期工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32824122/

10-12 00:40