Cocoa Objects
Coco Objects are actually pretty easy when you think about it. Every object has properties and or methods that can be called. When instantiating a cocoa object you have to allocate it and then initialize it. You can do that in a few ways but the most common way is to use a single line. Below is showing how you can instanciate an NSNumber Object.
OBJC:
In the code above you can see why method #1 is the preferred way, it is the easiest to read. Basically when instantiating an object in Objective-C you are saying I am creating a variable called number which is going to hold a value of type NSNumber. In the code to the right of the equals sign you are allocating and initializing the actual object. Pretty easy huh?






