我在容器視圖內使用UIActivityViewController。我想通過使用電子郵件,推特和臉書分享一些文字。雖然最後兩個作品完美我有一個電子郵件的問題。問題在於作曲家的觀點並不是通過取消事件,也不是試圖發送它來解散!當ActivityView出現我得到以下信息:容器視圖內的UIActivityViewController
Launch Services: Registering unknown app identifier com.apple.mobilemail failed
Launch Services: Unable to find app identifier com.apple.mobilemail
這是奇怪的,因爲真的是有與應用程序標識沒有問題,我可以分享與電子郵件文本,在其他視圖控制器使用ActivityViewController(如果不是在一個容器視圖)。 我的代碼,如下:
- (void)openBtnTouched {
NSString *alertTitleString = [[[GlobalVariables sharedInstance].alertsArray objectAtIndex:self.selectedIndex]objectForKey:@"alertTitle"];
NSString *alertMsgString = [[[GlobalVariables sharedInstance].alertsArray objectAtIndex:self.selectedIndex]objectForKey:@"alertMessage"];
UIActivityViewController *activity;
activity = [[UIActivityViewController alloc] initWithActivityItems:@[alertTitleString,alertMsgString] applicationActivities:nil];
activity.excludedActivityTypes = @[
UIActivityTypeMessage,
UIActivityTypePostToWeibo,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAssignToContact,UIActivityTypeCopyToPasteboard];
activity.completionHandler = ^(NSString *activityType, BOOL completed){
NSLog(@"Activity Type selected: %@", activityType);
if (completed) {
NSLog(@"Selected activity was performed.");
} else {
if (activityType == NULL) {
NSLog(@"User dismissed the view controller without making a selection.");
} else {
NSLog(@"Activity was not performed.");
}
}
};
[self presentViewController:activity animated:YES completion:NULL];
}