如何删除Xcode 6上的以下警告错误
指向整数转换的指针不兼容,指定来自'NSArray * __ strong'的'BOOL'(又名'签名字符')
下面我的代码是,
NSMutableArray *objectsToShareArr = [[NSMutableArray alloc] init];
[objectsToShareArr addObject:@"xyz"];
[objectsToShareArr addObject:@"abc"];
UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
image.image = [UIImage imageNamed:@"Default.png"];
UIActivity *activity = [[UIActivity alloc] init];
NSArray *applicationActivities = [[NSArray alloc] initWithObjects:activity, nil];
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:objectsToShareArr applicationActivities:applicationActivities];
NSArray *excludedActivities = @[ UIActivityTypeAirDrop, UIActivityTypePostToTwitter, UIActivityTypePostToFacebook,
UIActivityTypePostToWeibo,
UIActivityTypeMessage, UIActivityTypeMail,
UIActivityTypePrint, UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList, UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo];
controller.isAccessibilityElement = excludedActivities;
[self presentViewController:controller animated:YES completion:nil];
如果有人有解决方案,我真的很感谢你。
答案 0 :(得分:1)
删除此行:
controller.isAccessibilityElement = excludedActivities;
您应该这样做而不是添加共享选项:
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:excludedActivities applicationActivities:nil];