Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
4 + (id)object 5 { 6 return [[[self alloc] init] autorelease]; 7 } |
I said in the last section that objects created with +alloc have a retain count of one. In fact, all objects are created with a retain count of one, but objects created with a named constructor, such as +stringWithFormat: or +array, are also autoreleased.