Twitter + OAuth Problem -- Cancel Button
I'm implementing OAuth to post on Twitter... which works perfectly. My issue is for those who entered the Twitter login area by accident and want to press the "Cancel" button. Unfortunately, the "Cancel" button is dismissed but then immediately reappears.
Here is the code for the "Cancel" button:
- (void)cancel:(id)sender {
if ([_delegate respondsToSelector: @selector(OA开发者_如何学编程uthTwitterControllerCanceled:)]) [_delegate OAuthTwitterControllerCanceled: self];
[self performSelector: @selector(dismissModalViewControllerAnimated:) withObject: (id) kCFBooleanTrue afterDelay: 0.0];
}
I think what I need to do is put the right code in the viewDidDisappear
area... the problem is I don't know what code to put in.
Any help would be great! Thanks so much!
The problem is most likely not with the cancel button and the way it is handled, but in the way you call the code to post to twitter the first (and second) time. Place a break point in the line where you instantiate the twitter posting process, and see why it is being triggered a second time by inspecting the stack trace when it does break.
精彩评论