Possible Duplicate:
Use of alloc init instead of new (Objective-C)
Does any of you use +new
of the NSObject
to alloc & init the object?
Lets say i got an object C derived from Object B which all are from NSObject
. To create an instance of Object C
C newInstanceOfC = [C new]; // This will call the alloc & init of class C.
is this any better than
C newInstanceOfC = [C alloc] init];
other than less things to type. What is good practice?
cheers Arun