2
這是我創建的警報:UIAlertView中clickedButtonAtIndex不叫
UIAlertView* dialog = [[UIAlertView alloc] init];
dialog.delegate = self;
//some options
aField = [[UITextField alloc]initWithFrame:CGRectMake(20.0,45.0,245.0,25.0)];
[aField setBackgroundColor:[UIColor whiteColor]];
[dialog addSubview:appkeyField];
[dialog show];
[aField release];
然而
- (void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"test here");
}
什麼都不做。日誌中沒有任何東西!什麼可能是錯的?
你放置'UIAlertViewDelegate'協議在頭部? – 2011-05-10 18:06:57
謝謝,這是概率,讓這個答案! – 2011-05-10 18:15:08