Book Image

Xcode 4 iOS Development Beginner's Guide

By : Steven F. Daniel
Book Image

Xcode 4 iOS Development Beginner's Guide

By: Steven F. Daniel

Overview of this book

<p>The iPhone is one of the hottest mobile devices on the planet. Whether you are just starting out with iOS Development or already have some knowledge in this area, you will benefit from what this book covers. Using this book's straightforward, step-by-step approach, you will go from Xcode 4 apprentice to Xcode 4 Jedi master in no time.</p> <p><i>Xcode 4 iOS Development Beginner's Guide</i> will help you learn to build simple, yet powerful applications for the iPhone from the ground up. You will master the Xcode 4 tools and skills needed to create applications that are simple yet, like Yoda, punch far above their weight.</p> <p>You will start by learning about the Xcode 4 Development Tools, Xcode IDE, iOS Simulator, Objective-C 2, and Organizer. Then you will jump straight in and create applications using Xcode and Interface Builder. You finish up by learning how to build, package, and distribute your application to the Apple App Store.</p> <p>This book will teach you how to go about building simple applications from scratch, you will master how to download and install the Xcode 4 Development Tools, get to know the development environment and how to build great user interfaces (using Interface Builder), learn about the different iOS frameworks, learn how to implement video and audio playback, learn how to sense motion using the Accelerometer and Gyroscope, and how to improve the reliability and performance of your applications.</p> <p>After reading <i>Xcode 4 iOS Development Beginner's Guide</i>, you will be able to write your own applications for the iPhone with supreme efficiency. There are a lot of examples and images provided to get you up to speed quickly.</p>
Table of Contents (20 chapters)
Xcode 4 iOS Development
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Pop Quiz Answers
Index

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] 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...