Alert for iOS (UIAlertView)


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.