无法将Twitter视图添加到场景中

时间:2013-10-09 16:47:02

标签: cocoa-touch cocos2d-iphone

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

1 个答案:

答案 0 :(得分:0)

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

而不是显示模态视图的2行。