Beginning iOS Game Development by Patrick Alessi

Beginning iOS Game Development by Patrick Alessi

Author:Patrick Alessi
Language: eng
Format: epub, pdf
Publisher: John Wiley & Sons
Published: 2011-11-10T16:00:00+00:00


13. Build the project. The project should compile and link without any errors.

How It Works

The first interesting bit of code in this example is the initWithFrame:color: method. Users of your class will pass you a frame size and a color to initialize blocks of a specified color. First, as you should always do when overriding or creating an init function, you called the superclass initializer:

self = [super initWithFrame:frame];

Then, after ensuring that you got back an initialized instance, you added your code. In this case, you just set the color property of the class to whatever you received in the input parameter inputColor:

self.color = inputColor;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.