我收到以下警告 -
warning: passing argument 1 of 'dismissWithClickedButtonIndex:animated:' makes integer from pointer without a cast
[alertForLoading dismissWithClickedButtonIndex:nil animated:YES];
答案 0 :(得分:1)
dismissWithClickedButtonIndex:animated
期望NSInteger
作为参数,您指定的是nil。
将nil替换为您要按下的按钮的索引,如下所示:
[alertForLoading dismissWithClickedButtonIndex:0 animated:YES];
答案 1 :(得分:0)
“dismissWithClickedButtonIndex”正在接受任何int号。此方法调用以下UIAlertViewDelegate方法
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
请参阅referance获取更多信息:UIAlertViewDelegate Protocol Reference