0

我收到以下警告-

 warning: passing argument 1 of 'dismissWithClickedButtonIndex:animated:' makes integer from pointer without a cast

[alertForLoading dismissWithClickedButtonIndex:nil animated:YES];
4

2 回答 2

1

dismissWithClickedButtonIndex:animated期望 aNSInteger作为参数并且您指定 nil。

将 nil 替换为您想要按下的按钮的索引,如下所示:

 [alertForLoading dismissWithClickedButtonIndex:0 animated:YES];
于 2012-05-16T05:08:38.587 回答
0

“dismissWithClickedButtonIndex”接受任何整数。此方法调用以下 UIAlertViewDelegate 方法

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex

有关更多信息,请参阅参考:UIAlertViewDelegate 协议参考

于 2012-05-16T05:34:39.927 回答