Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Now that your class files are created and their header files filled in, you can continue to implement them. You need to start filling in the .m files for all the classes you created. The .h file simply outlines what types of operations and variables a class uses. The .m file is the piece of code that implements the creation of these variables and the execution of the declared methods.
Any instance variable that your subclass has must be initialized. Right now, these variables have types and names, but you must tell the application to allocate some space in memory for them and to connect these variable names to actual memory. This is usually done in two parts. First, the variable needs to have space allocated for it, using the alloc method. Second, the variable must be initialized, using the init method of your class. Every class should have an init method where the instance variables and general setup for the class are performed. Let’s set up the init methods for your new classes.