在我的 iPhone 应用程序中,我设置了长按以显示警报框,当我在测试中长按时,它会打开警报,但我必须在它消失之前单击“确定”3 次。几乎就像它打开了 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];
}