Possible Duplicate:
cancelling queued performSelector:afterDelay calls
I have code to delay displaying my result by 6 seconds. However, I want to be able to abort this delay if the user continues on. I'm not sure how I can cancel the delay method call once it's started. Can someone please point me in the right direction?
This is the code I use to call the delay method and the method below.
[self performSelector:@selector(delay) withObject:nil afterDelay:6.0];
-(void)delay{
[buttonScreen setFont:[UIFont systemFontOfSize:32.0]];
buttonScreen.text = [formatter stringFromNumber:[NSNumber numberWithDouble:result]];
}