{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
Test Your Knowledge: View Controller for the First iPhone Application Explained
Summary
This is a test on the article that explains the view controller of an iPhone application. In this case, the view contains just a table and hence the controller is derived from UITableViewController class. Class diagram, general view methods, and general table methods are discussed.
 
Table of Contents

Creation of the first iPhone application

Source Files

The Class Diagram

Figure 1. The class diagram for a view controller that is derived from the table view controller.

The Header File

Code Listing 1. The Root View Controller Declaration

The Implementation File

Code Listing 2. The implementation file for the root view controller

Standard View Controller Methods

shouldAutorotateToInterfaceOrientation

Code Listing 3. The shouldAutorotateToInterfaceOrientation method

Figure 2. The callstack leading to shouldAutoRotateToInterfaceOrientation

Figure 3. The user interface has not been rotated automatically when the iPhone is rotated. This is because the method shouldAutorotateToInterfaceOrientation returned NO.

Code Listing 4. Automatically rotating the user interface in an iPhone application

Figure 4. The user interface has been rotated automatically when the iPhone is rotated. This is because the method shouldAutorotateToInterfaceOrientation returned YES.

didReceiveMemoryWarning

Code Listing 5. The didReceiveMemoryWarning method

Figure 5. The callstack leading up to didReceiveMemoryWarning

dealloc

Code Listing 6. The dealloc method

Table View Controller Specific Methods

Code Listing 7. The declaration of UITableViewController

Figure 6. The connections panel of the table view

numberofSectionsInTableView

Code Listing 8. The numberOfSectionsInTableView method

numberOfRowsInSection

Code Listing 9. The numberOfRowsInSection method

cellForRowAtIndexPath

Code Listing 10. The cellForRowAtIndexPath method

didSelectRowAtIndexPath

Code Listing 11. The didSelectRowAtIndexPath method

 
Take the Test
Start the Test:
View Controller for the First iPhone Application Explained
Read the Article
Go to Article:
View Controller for the First iPhone Application Explained
Review Answers for Questions in this Test
Article Series
Previous Article:
View Controller for the First iPhone Application Explained
This article is part of the Series:
Article Series: Getting started with iPhone development
Next Article: This is the Last Article of the Series
Bookmark and Share This

More Articles With Similar Tags
This is a test on the article that gives a quick overview of the development tools installed with iPhone SDK. These tools include Xcode, Interface Builder, Instruments, and iPhone Simulator. In the article, Dash Code, which is used to build web applications for iPhone is also introduced. GDB, the open source debugger, is discussed there as well.
icon-xcode-groups-files.jpg
This article discusses various parts of the Project window inside an Xcode project. It also gives a quick overview of the Groups and Files navigation window. The Run menu, the default toolbar, and the built-in source editor are also discussed.
This is a test on the article that discusses various parts of the Project window inside an Xcode project. It also gives a quick overview of the Groups and Files navigation window. The Run menu, the default toolbar, and the built-in source editor are also discussed.
icon-xcode-interface-builder-connection-panel.jpg
This article explains the user interface files of an iPhone application. Explains the contents of the .xib files, which store the user interface. Goes through the various windows (Document Window, User Interface Window, Inspector Window, Library Window, Connections Panel) of the Interface Builder. The example used is a simple navigation-based iPhone application.
This is a test on the article that explains the user interface files of an iPhone application. It explains the contents of the .xib files, which store the user interface. Goes through the various windows (Document Window, User Interface Window, Inspector Window, Library Window, Connections Panel) of the Interface Builder. The example used is a simple navigation-based iPhone application.
About  Contact  Privacy Policy  Site Map