我正在使用UIActivityViewController
来共享网址和字符串。网址不再显示,我无法解释原因:
这是我的代码:
NSString *shareString = @"blabla string.";
NSURL *shareUrl = [NSURL URLWithString:@"www.google.com"];
NSArray *activityItems = [NSArray arrayWithObjects:shareUrl, shareString, nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[activityViewController setValue:@"Blabla." forKey:@"subject"];
activityViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
activityViewController.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeAssignToContact, UIActivityTypeAddToReadingList, UIActivityTypeAirDrop, UIActivityTypeSaveToCameraRoll, UIActivityTypeCopyToPasteboard];
[self presentViewController:activityViewController animated:YES completion:nil];
答案 0 :(得分:0)
你忘了添加" http://"到你的链接。
NSURL * shareUrl = [NSURL URLWithString:@" http://www.google.com"];