網頁

2012年9月26日 星期三

Multiple UIAlertView

Adding a simple UIAlertView



Multiple UIAlertView; each with their own buttons and actions


#pragma mark -
#pragma mark alert delegate

- (void) alertView: (UIAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex
{
    
    if (alertView.tag == TAG_STOP) { // handle the altdev
        NSLog(@"STOP!");
        
        // the user clicked cancel
        if (buttonIndex == 0)
        {
            
            NSLog(@"CANCEL!!");
            
        }
        else {
            
            mockTestFinish = YES;
           
            [avPlayer stop];
  
            
            [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] animated:YES];
        }

       
    } 
    if (alertView.tag == TAG_TIMEUP){ // handle the donate
            NSLog(@"TIME'S UP!");     
         // [avPlayer stop]; before alert methods
        
        // the user clicked OK
        if (buttonIndex == 0)
        {
      
           // do something

        }

    }
 
}

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。