Chapter 3. Views, Outlets, and Actions

WHAT YOU WILL LEARN IN THIS CHAPTER

  • How to declare and define outlets

  • How to declare and define actions

  • How to connect outlets and actions to the views in your View window

  • How to use the UIAlertView to display an alert view to the user

  • How to use the UIActionSheet to display some options to the user

  • How to use the UIPageControl to control paging

  • How to use the UIImageView to display images

  • How to use the UIWebView to display Web content in your application

  • How to add views dynamically to your application during runtime

In the previous chapter, you built a simple Hello World! iPhone application without understanding much of the underlying details of how things work together. In fact, one of the greatest hurdles in learning iPhone programming is the large number of details you need to learn before you can get an application up and running. This book aims to make the iPhone programming experience both fun and bearable. Hence, this chapter starts with the basics of creating the user interface (UI) of an iPhone application and how your code connects with the various graphical widgets.

Outlets and Actions

One of the first things you need to understand in iPhone programming is outlets and actions. If you are familiar with traditional programming languages such as Java or C#, this is a concept that requires some time to get used to — the concepts are similar, just that it is a different way of doing things. At the end of this section, you will have a solid understanding ...

Get Beginning iOS 4 Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.