嗨,我在iOS应用程序中有两个UIButton.一个是发布到Twitter,第二个是发布到Facebook.Facebook按钮工作得很好但是推文给我留下了一些问题,推文表将打开填充文本,但需要两次点击取消按钮才能解除.如果我点击发送,将发送推文并且表单被解雇,但我的应用程序冻结并变得无法响应.我已经包含了两位代码
- (IBAction)postTweet:(id)sender {
// if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]){
myTweet = [[SLComposeViewController alloc]init];
myTweet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
NSString *tweetString = [[NSString alloc]initWithFormat:@"%@\n%@\nvia @ValuatorApp", pdOne.text, pdTwo.text];
[myTweet setInitialText:tweetString];
[myTweet addURL:[NSURL URLWithString:@"http://sjb007.me/TheValuator"]];
[self presentViewController:myTweet animated:YES completion:nil];
// }
[myTweet setCompletionHandler:^(SLComposeViewControllerResult result) {
NSString *output = [[NSString alloc]init];
switch (result) {
case SLComposeViewControllerResultCancelled:
output = @"Twitter Post Cancelled";
break;
case SLComposeViewControllerResultDone:
output = @"Twitter post Succesful";
break;
default:
break;
}
NSLog(@"%@",output);
}];
}
- (IBAction)postFacebook:(id)sender {
// if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]){
myTweet = [[SLComposeViewController alloc]init]; …Run Code Online (Sandbox Code Playgroud)