Our
next step is to implement our displayAlertDialog
method. This method will be responsible for displaying an alert message to the user when the Display Alert Dialog is pressed. The user will be able to respond to the buttons displayed, which will dismiss the dialog:
Open the
GetUsersAttentionViewController.m
implementation file.In the action event which you created for the Display Alert Dialog button, add the following code:
// Handles of the setting up and displaying of our Alert View Dialog - (IBAction)displayAlertDialog:(id)sender { // Declare an instance of our Alert View dialog UIAlertView *dialog; // Initialise our Alert View Window with options dialog =[[UIAlertView alloc] initWithTitle:@"Alert Message" message:@"Have I got your attention" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil]; // display our dialog and free the memory allocated by our dialog box [dialog show...