Return to Snippet

Revision: 52809
at November 1, 2011 23:39 by peruggia


Updated Code
/*
Simple alert for iOS applications
*/

// Alloc and init the alert object
UIAlertView *alert = [[UIAlertView alloc] 

// Alert window title
initWithTitle: NSLocalizedString(@"",nil)

// Message that will be displayed
message: NSLocalizedString(@"",nil)

// UIAlertView delegate (No protocol conformance required)
delegate: self

// Text for the main button
cancelButtonTitle: NSLocalizedString(@"No",nil)

// A second button or just nil for none
otherButtonTitles: NSLocalizedString(@"Yes",nil), nil];

// Display the alert
[alert show];

// Release the object
[alert release];

Revision: 52808
at November 1, 2011 23:24 by peruggia


Initial Code
/*
Simple alert for iOS applications
*/

// Alloc and init the alert object
UIAlertView *alert = [[UIAlertView alloc] 
// Alert window title
initWithTitle: NSLocalizedString(@"",nil)
// Message that will be displayed
message: NSLocalizedString(@"",nil)
// UIAlertView delegate (No protocol conformance required)
delegate: self
// Text for the main button
cancelButtonTitle: NSLocalizedString(@"No",nil)
// A second button or just nil for none
otherButtonTitles: NSLocalizedString(@"Yes",nil), nil];
// Display the alert
[alert show];
// Release the object
[alert release];

Initial URL


Initial Description


Initial Title
Alert for iOS (UIAlertView)

Initial Tags
ios

Initial Language
Objective C