SLComposeViewController を cocos2D レイヤーのボタンから取得できないようです。この動作を停止するものがあれば教えてください。任意の助けをいただければ幸いです: NB viewController は UIViewController です
-(void)sceneSelect
{
NSString *message = [NSString stringWithFormat:@"Twitter Message"];
NSString *serviceType = [NSString stringWithFormat:@"SLServiceTypeTwitter"];
if ([SLComposeViewController isAvailableForServiceType:serviceType])
{
SLComposeViewController *tweetController = [SLComposeViewController composeViewControllerForServiceType:serviceType];
[tweetController setInitialText:message];
tweetController.completionHandler = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultDone){
//NSLog call
}
else if (result == SLComposeViewControllerResultCancelled){
//NSLog call
}
[viewController dismissViewControllerAnimated: YES completion: nil];
};
[[[CCDirector sharedDirector]openGLView]addSubview:viewController.view];
[viewController presentViewController:tweetController animated:YES completion:nil];
}
else
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Twitter" message:@"Twitter not working" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alertView show];
}
}