Hi! In Cocoa Fundametals I found following code:
@interface ValidatingArray : NSMutableArray {
NSMutableArray *embeddedArray;
}
@end
@implementation ValidatingArray
- init {
self = [super init];
if (self) {
embeddedArray = [[NSMutableArray allocWithZone:[self zone]] init];
return self;
}
@end
But I don't understand this line of code:
embeddedArray = [[NSMutableArray allocWithZone:[self zone]] init];
Why we use this initialization instead of simple memory allocation:
embeddedArray = [[NSMutableArray alloc] init];