我正在开发一个游戏,我必须在我的 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];
}
请给我这个问题的有效解决方案。