1
我似乎无法让SLComposeViewController来自cocos2D图层上的按钮。如果你能看到任何会阻止这项工作的事情,请告诉。任何帮助将不胜感激:的viewController是一个UIViewController将SLComposeViewController实现为Cocos2d
-(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];
}
}
感谢您的响应。我试过了,它适用于UIActivityView,但不能让它适用于SLComposeViewController,这就是为什么我尝试了上述。我会继续尝试,看看我能得到什么,否则我会用UIActivityView运行。任何其他见解都会很棒。 – user2318726 2013-04-26 02:32:32
不要将它添加为子视图.... http://pastebin.com/XgK73Rm7 – Guru 2013-04-26 04:07:43
http://pastebin.com/hpRRJM1n – Guru 2013-04-26 04:19:32