Game Development Reference
In-Depth Information
Xcode
Developed by Apple, Xcode is an SDK for developing software for OS X and iOS.
Initially released in 2003, you can download the latest stable release (version 4.5.2)
for free from the Mac App Store. If you are a registered developer, you can download
preview releases and previous versions of the suite through the Apple Developer
website.
The suite includes the Xcode IDE and the Interface Builder. It also has most of the
Apple's developer documentation; the Interface Builder is used to construct graphic-
al user interfaces.
Working with objects
When building apps for OS X or iOS, you'll spend most of your time working with ob-
jects. In this case, objects are instances of Objective-C classes, some of which are
provided for you by Cocoa or Cocoa Touch and some of which you'll write yourself.
To create your own class, you need to start with a description that includes its public
properties and a list of methods. Methods must include what kind of messages it can
receive, what happens when the method is called, and the necessary code to imple-
ment the method.
Extending classes with categories
Instead of creating an entirely new class to provide minor additional capabilities over
an existing class, you can define a category to add functionality to an existing class.
You can use a category to add methods to any class, including classes for which you
don't have the original implementation source code.
With a class' source code, you can add new properties or change its current proper-
ties with class extensions. Class extensions are particularly useful when customizing
a framework.
Protocols define messaging contracts
Generally, the work in an Objective-C app happens when objects send messages to
each other. Usually, the construct of messages is determined by the methods defined
Search WWH ::




Custom Search