2010-07-31 77 views
0

下面的代码应该显示一个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

存在=缺少:)

编辑 检查这个

if(buttonindex == [actionsheet cancelButtonIndex]){ 
+0

其中缺少= – 2010-07-31 10:37:03