Ios SLComposeViewController InitWithService类型无法获取扩展错误
我正在我的一个应用程序中使用Facebook和Twitter共享。测试时,我突然发现以下错误。我检查了我的代码,我觉得没问题Ios SLComposeViewController InitWithService类型无法获取扩展错误,ios,objective-c,xcode,facebook,twitter,Ios,Objective C,Xcode,Facebook,Twitter,我正在我的一个应用程序中使用Facebook和Twitter共享。测试时,我突然发现以下错误。我检查了我的代码,我觉得没问题 2017-04-29 14:41:19.727248 iCamTranslator[1140:322770] [core] SLComposeViewController initWithServiceType failed to get extension for identifier com.apple.share.Facebook.post 2017-04-29 1
2017-04-29 14:41:19.727248 iCamTranslator[1140:322770] [core] SLComposeViewController initWithServiceType failed to get extension for identifier com.apple.share.Facebook.post
2017-04-29 14:41:19.727642 iCamTranslator[1140:322770] [core] SLComposeViewController dealloc <SLComposeViewController: 0x102992050>
2017-04-29 14:41:19.750499 iCamTranslator[1140:322770] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <AboutViewController: 0x102986900>.'
非常感谢您的帮助 这个愚蠢的错误是因为我没有在我的设备上更新我的Facebook应用程序。更新后,一切正常。对不起打扰你们了
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled)
{
NSLog(@"Cancelled");
}
else
{
NSLog(@"Done");
}
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
[controller setInitialText:@"iCamTranslator is a great translation app."];
[controller addURL:[NSURL URLWithString:@"https://itunes.apple.com/us/app/icamtranslator/id955853183?mt=8"]];
[controller addImage:[UIImage imageNamed:@"logo-2.png"]];
[self presentViewController:controller animated:YES completion:Nil];
}