它没有代表.一旦当前视图控制器被解除,该怎么办?
解决方法 在Apple文档中,您会发现SLComposeVIEwController具有完成处理程序属性而不是委托.您只需要使用setCompletionHandler方法设置该属性.然后使用常量SLComposeVIEwControllerResult来恢复帖子是发布还是取消,并相应地采取措施.-(voID) sharetoFacebook {//1. Set link and imageNsstring *applink = @"https://itunes.apple.com/app/ID989793966";UIImage *twitterImage = [UIImage imagenamed:@"TF_400x400.png"];//2. Check if we can shareif ([SLComposeVIEwController isAvailableForServiceType:SLServiceTypeFacebook]) { //3. Compose the share vIEw controller SLComposeVIEwController *FBVIEwController = [SLComposeVIEwController composeVIEwControllerForServiceType:SLServiceTypeFacebook]; [FBVIEwController addURL:[NSURL URLWithString:applink]]; [FBVIEwController addImage:twitterImage]; //4 Set completion handler and define actions to take [FBVIEwController setCompletionHandler:^(SLComposeVIEwControllerResult result) { if (result == SLComposeVIEwControllerResultCancelled) { [self addEmptyScreenbuttonTargets]; } else if (result == SLComposeVIEwControllerResultDone) { //Unlock words; show thank you screen [NewCardManager unlockWordsForPackage:4]; [self openFBThankYouScreen]; } }]; //5. Call to modally present the share controller [self presentVIEwController:FBVIEwController animated:YES completion:nil];}
}
总结以上是内存溢出为你收集整理的ios – 为什么SLComposeViewController没有委托?全部内容,希望文章能够帮你解决ios – 为什么SLComposeViewController没有委托?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)