我正在开发一个游戏,在这个游戏中,我必须在我的脸书和twitter上发布分数。
我写过这段代码,但它不起作用。它既没有给任何错误,也没有弹出任何张贴的东西。
- (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];
}请给我这个问题的有效解决办法。
发布于 2013-09-09 05:24:22
CCDirector是UIViewController在iOS中的一个子类。因此,它可以用于表示模态viewControllers。
[[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_VIEWCONTROLLERhttps://stackoverflow.com/questions/18691687
复制相似问题