You can create popup messages showing a title, a message, an a set of buttons. In my example the button "Clear Data" call this popup message to confirm the action. These are the steps needed to create the popup message:
1. Add
2. Create the alert message with the following code:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"WARNING"
message:@"All data wil be erased. Are you sure?"
cancelButtonTiltle:@"Cancel",
otherButtonTitles:@"Ok", nil ];
[alert show]
[alert release] ------> if you have ARC enabled don´t use this line.
3. And finally you must use the following method to control which button was pressed, and its associated action.
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
No hay comentarios:
Publicar un comentario