O'Reilly logo

Xcode 4 iOS Development by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – implementing the Display Alert Dialog method

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:

  1. Open the GetUsersAttentionViewController.m implementation file.
  2. 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] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required