我正在尝试添加一个Twitter视图,以便我可以看到它被调用,并且该帐户已连接,但Twitter表格不存在...
它位于CCScene
。(cocos2d)
if ([TWTweetComposeViewController canSendTweet])
{
//we can log here
TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];
[tweetViewController setInitialText:@"message"];
tweetViewController.completionHandler = ^(TWTweetComposeViewControllerResult result)
{
if(result == TWTweetComposeViewControllerResultDone)
{
} else if(result == TWTweetComposeViewControllerResultCancelled)
{
}
[viewController dismissViewControllerAnimated:YES completion:nil];
};
// present view controller
[[[CCDirector sharedDirector] view] addSubview:viewController.view];
[viewController presentViewController:tweetViewController animated:YES completion:nil];
}
else
{
NSLog(@"NO TWITTER ");
}
答案 0 :(得分:0)
[[CCDirector sharedDirector]presentModalViewController:tweetViewController animated:YES];
而不是显示模态视图的2行。