Defining Classes in Your App
Before you can create objects in memory, you have to decide what they should do in your app. You can then add class definition files that define the features of your new objects.
This is a multi-stage process. Follow these steps:
1. Decide what you want the class to do. Sometimes this question has an obvious answer; all apps have an App Delegate and most have at least one View Controller, so most apps include these objects. Other objects, such as those for video and sound support and extended graphics, are optional, and you must find them and add them as needed. (Don’t forget that you can search online for sample code.)
2. Look through the documentation to find an existing iOS class that matches your needs.
A useful timesaver is to look for sample code to see which objects Apple and other developers have used to add a feature. You can take these “recipes” and modify them. This is quicker than creating code from scratch.
The iOS kit-of-parts objects solve specific problems and add specific features such as styled text, video, Twitter support, and so on. If your app has some unique requirements—for example, if it’s an original game—it’s likely you’ll have to use the more generic data collection objects in iOS and build your own code around them. ...