0

我正在尝试添加一个 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  ");
    }
4

1 回答 1

0
[[CCDirector sharedDirector]presentModalViewController:tweetViewController animated:YES];

而不是呈现模态视图的 2 行。

于 2013-10-09T17:04:40.927 回答