Revision: 34680
                            
                                                            
                                    
                                        
Initial Code
                                    
                                    
                                                            
                                    
                                        
Initial URL
                                    
                                    
                                
                                                            
                                    
                                        
Initial Description
                                    
                                    
                                                            
                                    
                                        
Initial Title
                                    
                                    
                                                            
                                    
                                        
Initial Tags
                                    
                                    
                                
                                                            
                                    
                                        
Initial Language
                                    
                                    
                                                    
                        at October 27, 2010 03:44 by BenClayton
                            
                            Initial Code
// confirm the deletion..
UIAlertView *alert = [[UIAlertView alloc] 
  initWithTitle: theTitle
  message: msg
  delegate: self
  cancelButtonTitle: @"Cancel"
  otherButtonTitles: @"Delete", nil];
  alert.tag = LIST_CONFIRM_DELETE; // should use a different define (e.g. to 1) each time you use an alertview in a class, as each will call the same clickedButtonAtIndex selector.
[alert show];
[alert release];
// Called when an alertview button is clicked
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
	switch (alertView.tag) {
		case LIST_CONFIRM_DELETE:
		{
			switch (buttonIndex) {
				case 0: // cancel
				{	
					NSLog(@"Delete was cancelled by the user");
				}
					break;
				case 1: // delete
				{
					// do the delete
				}
					break;
			}
			
			break;
		default:
			NSLog(@"WebAppListVC.alertView: clickedButton at index. Unknown alert type");
		}
	}	
}
                                Initial URL
Initial Description
You must add UIAlertViewDelegate to the protocols for your class
Initial Title
iPhone: Use UIAlertView to confirm a deletion
Initial Tags
Initial Language
Objective C