Possible Duplicate:
what is difference between alloc and allocWithZone:?
I read an article that mentions using allocWithZone
helps improve performance by using a memory location closer to the object itself. Is this true? and is it recommended to use allocWithZone
instead of alloc
? What is the difference between alloc and allocWithZone?
The example proveded was:
- (id)init
{
if (self = [super init])
{
_myString = [[NSString allocWithZone:[self zone] init]];
}
return self;
}