SUMMARY
This chapter provided a detailed look at the various application templates provided by the iOS SDK: Single View Application, Empty Application, Master-Detail Application, and Tabbed Application. Each one uses a different type of View controller. It is important to have a good understanding of how the various pieces of an iOS project are put together — knowing that enables you to build applications with sophisticated user interfaces.
EXERCISES
- Write the code snippet that enables you to create a View controller programmatically.
- Write the code snippet that creates a view dynamically during runtime.
- Write the code snippet that wires an event of a view to an event handler.
- In the EmptyApp project created earlier in this chapter, create an action to display an alert view when the button in the HelloWorldViewController class is pressed.
Answers to the exercises can be found in Appendix D.
WHAT YOU LEARNED IN THIS CHAPTER
TOPIC | KEY CONCEPTS |
Types of iPhone/iPad Applications | Single View application, Empty application, Master-Detail application, and Tabbed Application |
Coding a Label view |
label = [[UILabel alloc] initWithFrame:frame]; label.textAlignment = UITextAlignmentCenter; label.font = [UIFont fontWithName:@“Verdana” size:20]; label.text = @“This is a label”; |
Coding a Button view |
frame = CGRectMake(20, 60, 280, 50); button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; ... |
Get Beginning iOS 5 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.