Real Classes in Real Action
You can learn a lot—and I mean a lot—by examining the sample apps that come with the iOS SDK. Many of the samples focus on illustrating a particular aspect of the SDK or frameworks, which means they may not be sterling examples of complete apps. But some samples give you a sense of the way you should start breaking your app idea into classes and groups of classes—a very important skill to develop in an object-oriented programming world. In Chapter 2, you loaded TheElements project into Xcode. Let’s take a closer look at the source file structure for that app to see how the author divided the work among class files. I don’t expect you to understand all of the inner workings of the app at this point. The goal here is to give you a preview of what lies in store for you when it comes time to develop a real app rather than merely a simple demo app.
TheElements Overview
As sample apps go, TheElements is relatively complex. It demonstrates a number of user interface features and view classes, such as the tab bar interface (with buttons along the bottom of the screen that change modes) and tables. Assuming you set the Base SDK to Latest iOS as shown in Chapter 2, build and run the app in the simulator now to get more acquainted with the app’s structure from a user’s perspective (Figure 8-4).
The app opens to one of four table views. As you tap on different buttons in the bottom tab bar, a different table view appears with a unique sorting order. If you tap on an ...
Get Learning the iOS 4 SDK for JavaScript Programmers 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.