我正在将SLService
Twitter
集成到应用程序中。它在iPhone上运行良好,但在iPad上消失了。
我已经集成在iPad上:
[actionSheet showFromRect:self.myRect inView:self.tableView animated:YES];
而不是:
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
iPad是否有类似的方法代替presentViewContoller: Animated:
?
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:self.textForTweet];
[self presentViewController:tweetSheet animated:YES completion:nil];
} else [self displayAlertBoxWithTitle:@"Tweet Failed" message:@"Please try again later" cancelButton:@"Close"];
}
我应该使用模态对话框吗?
答案 0 :(得分:2)
我最初错过了此错误消息:
dispatch_async(dispatch_get_main_queue(), ^ {
[self presentViewController:tweetSheet animated:YES completion:nil];
});
这引导我在不同的背景下讨论同一问题here。
通过建议的解决方法解决了这个问题:
=$1