当我在facebook上使用共享功能时,我无法看到字符串和链接,下面是示例代码。
NSArray * activityItems = @[[NSString stringWithFormat:@"Some initial text."], [NSURL URLWithString:@"http://www.google.com"]];
NSArray * applicationActivities = nil;
NSArray * excludeActivities = @[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeMessage];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
activityController.excludedActivityTypes = excludeActivities;
[self presentViewController:activityController animated:YES completion:nil];
答案 0 :(得分:1)
您的链接必须是NSURL对象:
NSString *link = @"http://itunes.apple.com/app/id00000000";
NSArray *activityItems = @[ [NSURL URLWithString: link] ];
答案 1 :(得分:0)