1

Facebook と Twitter a/c にスコアを投稿する必要があるゲームを開発しています。

このコードを書きましたが、機能しません。何かを投稿するためのエラーやポップアップは表示されません。

  - (void) SLComposeViewControllerButtonPressed: (id) sender{

 if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{

    AppDelegate * myDelegate = (((AppDelegate*) [UIApplication sharedApplication].delegate));

    NSString *string = [NSString stringWithFormat:@"Just scored %d. ", 10];

    SLComposeViewController*fvc = [SLComposeViewController
                                   composeViewControllerForServiceType:SLServiceTypeTwitter];
    [fvc setInitialText:string];
     [[myDelegate navController]  presentViewController:fvc animated:YES completion:nil];
}

この問題の有効な解決策を教えてください。

4

1 に答える 1

4

CCDirectorUIViewControllerはiOSの のサブクラスです。そのため、モーダル ビュー コントローラーの表示に使用できます。

[[CCDirector sharedDirector] presentViewController:fvc animated:YES completion:nil];

更新:ここに DOC があります

  #ifdef __CC_PLATFORM_IOS
  #define CC_VIEWCONTROLLER UIViewController
  #elif defined(__CC_PLATFORM_MAC)
  #define CC_VIEWCONTROLLER NSObject
  #endif

  @interface CCDirector : CC_VIEWCONTROLLER
于 2013-09-09T05:24:22.503 に答える