1 @interface LoginViewController : UIViewController
//UIButton 委托方法
1 - (void)loginAction:(UIButton *)sender{ 2 UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"登录成功" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil]; 3 [alertView show]; 4 } 5 6 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ 7 NSLog(@"adgsvjdsfbdf"); 8 }
可以执行,不警告,也不报错