我在其完成块中处理了推文取消和完成条件,它正在工作,当我发送重复推文时,它显示重复推文错误消息很好,但我的问题是在重复错误之后它显示推文已完成消息,所以我想停止推文完成消息如果出现重复的错误消息,请解决我的问题。这是我的工作代码。
self.tweetSheet = [[TWTweetComposeViewController alloc] init];
[self.tweetSheet setInitialText:@"Some message."];
[self.navigationController presentModalViewController:self.tweetSheet animated:YES];
// Called when the tweet dialog has been closed
self.tweetSheet.completionHandler = ^(TWTweetComposeViewControllerResult result)
{
NSString * msg;
if (result == TWTweetComposeViewControllerResultCancelled)
{
msg = @"Tweet compostion was canceled.";
}
else if (result == TWTweetComposeViewControllerResultDone)
{
NSLog(@"result %d",result);
msg = @"Tweet composition completed.";
}
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Tweet Status" message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
// Show alert to see how things went...
[self.tweetSheet dismissModalViewControllerAnimated:YES];
// Dismiss the controller
};
}