concept initialization in category ios
appears as: initialization, initialization

This is an excerpt from Manning's book Objective-C Fundamentals.
This code sample explicitly demonstrates the two stages of constructing a new object in Objective-C: allocation and initialization. The first line sends the alloc (short for allocate) message to the NSString class. This causes NSString to assign enough memory to store a new string and returns a C-style pointer to that memory. At this stage, however, the object is rather blank, so the next step is to call an initialization method to initialize the object with some kind of sensible value.
Listing 5.6. Merging allocation and initialization into one easy-to-call method
+ (id)rentalPropertyOfType:(PropertyType)newPropertyType rentingFor:(float)newRentalPrice atAddress:(NSString *)newAddress { id newObject = [[CTRentalProperty alloc] initWithAddress:newAddress rentalPrice:newRentalPrice andType:newPropertyType]; return [newObject autorelease]; }