我正在更改我的应用程序以供 iOS6 和 iPhone 使用,我似乎无法弄清楚为什么当我使用新的社交框架从 Twitter 发帖时,我必须按两次“取消”才能关闭,其他人都有这个问题或修复?这是按钮的代码。
- (IBAction)twitterPost:(id)sender
{
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
mySLComposerSheet = [[SLComposeViewController alloc] init];
mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[mySLComposerSheet setInitialText:[NSString stringWithFormat:@"This is my tweet, hello!",mySLComposerSheet.serviceType]];
[self presentViewController:mySLComposerSheet animated:YES completion:nil];
}
[mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
NSLog(@"dfsdf");
switch (result) {
case SLComposeViewControllerResultCancelled:
break;
case SLComposeViewControllerResultDone:
break;
default:
break;
}
}];
}