在我的iPhone应用程序中,我设置了长按以显示警告框,当我长时间按下测试时会打开警报但是我必须在它消失之前单击“确定”3次。它是almsot,它打开了3个长按警报窗口,而不仅仅是一个。
我做错了什么?这是我用来处理长按的代码:
- (void)didLongPress_imageButton3:(UILongPressGestureRecognizer *)recognizer {
UIAlertView *alertView = [[UIAlertView alloc] init];
alertView.title = @"The Info";
alertView.message = @"Details of what is in the project.";
[alertView addButtonWithTitle:@"OK"];
[alertView show];
[alertView release];
}