tags:

views:

27

answers:

2

The following code should show a UIAlertView in response to a button being clicked in a UIActionSheet, but I can't figure out why it doesn't work. Does someone have an idea as to why this is?

-(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];
}
+1  A: 

there is an = missing :)

EDIT check this

 if(buttonindex == [actionsheet cancelButtonIndex]){
hib
where is = missing
question
+1  A: 

itdoesnot works inside other functins it must be separate

pankaj kainthla