以下代码应显示UIAlertView以响应在UIActionSheet中单击的按钮,但我无法弄清楚它为什么不起作用。有人知道为什么会这样吗?
-(void)actionsheet:(UIActionSheet *)actionsheet willDissmissAtButtonIndex:(NSInteger)
buttonindex{
if(buttonindex =[actionsheet cancelButtonIndex]){
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"welcome"
message:@"thanku for watching" delegate:self cancelButtonTitle:@"bye"
otherButtonTitles:nil];
[alert show];
[alert release];
}
答案 0 :(得分:0)
有一个=缺失:)
修改强> 检查一下
if(buttonindex == [actionsheet cancelButtonIndex]){