我收到以下警告-
warning: passing argument 1 of 'dismissWithClickedButtonIndex:animated:' makes integer from pointer without a cast
[alertForLoading dismissWithClickedButtonIndex:nil animated:YES];
dismissWithClickedButtonIndex:animated
期望 aNSInteger
作为参数并且您指定 nil。
将 nil 替换为您想要按下的按钮的索引,如下所示:
[alertForLoading dismissWithClickedButtonIndex:0 animated:YES];
“dismissWithClickedButtonIndex”接受任何整数。此方法调用以下 UIAlertViewDelegate 方法
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
有关更多信息,请参阅参考:UIAlertViewDelegate 协议参考