UILongPressGestureRecognizer and dismissPopoverAnimated:
I have a UIPopover being called when the UILongPressGesture is being fired. UIPopOver appears, displays fine, all is okay with the world.
I want the UIPopover to disappear when the gesture is ended either by the finger lifting or moving. I do this by specifying:
if (longPress.state == UIGestureRecognizerStateEnded) {
[thePopover dismissPopoverAnimated:YES];
NSLog(@"you let off");
}
This doesn't work. NSLog fires but dismissPopover doesn't. Stranger enough, if I build a method that does call dismissPopover and wrap it in a performSelector: withObject: afterDelay: , that works fine unless I put it within
if (longPress.state == UIGestureRecognizerStateEnded) {
[self performSelector:@sel开发者_Go百科ector(releasePopover:) withObject:thePopover afterDelay:2.0];
NSLog(@"you let off");
}
Any thoughts as to why this would be?
精彩评论