Posted By

peruggia on 11/01/11


Tagged

alert UIAlertView ios


Versions (?)

Alert for iOS (UIAlertView)


 / Published in: Objective C
 

  1. /*
  2. Simple alert for iOS applications
  3. */
  4.  
  5. // Alloc and init the alert object
  6. UIAlertView *alert = [[UIAlertView alloc]
  7.  
  8. // Alert window title
  9. initWithTitle: NSLocalizedString(@"",nil)
  10.  
  11. // Message that will be displayed
  12. message: NSLocalizedString(@"",nil)
  13.  
  14. // UIAlertView delegate (No protocol conformance required)
  15. delegate: self
  16.  
  17. // Text for the main button
  18. cancelButtonTitle: NSLocalizedString(@"No",nil)
  19.  
  20. // A second button or just nil for none
  21. otherButtonTitles: NSLocalizedString(@"Yes",nil), nil];
  22.  
  23. // Display the alert
  24. [alert show];
  25.  
  26. // Release the object
  27. [alert release];

Report this snippet  

You need to login to post a comment.