在我的程序中,我的警报只显示一次,然后再次调用时不显示。
该按钮仍然取消触摸,就好像显示警报一样,但是没有警报显示。
如果能找到答案那就太好了,这是我的代码:
for (int x = 1; x <= 9; x ++) {
if ([[defaults objectForKey:[NSString stringWithFormat:@"fav%i",x]] isEqualToString:resultButton.currentTitle] || [[defaults objectForKey:[NSString stringWithFormat:@"fav%i",x]] isEqualToString:[NSString stringWithFormat:@"%@ Converter", resultButton.currentTitle]]) {
UIAlertView *alertThere = [[UIAlertView alloc] initWithTitle:resultButton.currentTitle message:@"Is currently in Favorites." delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil, nil];
[alertThere show];
[alertThere release];
return;
}
}
谢谢!