Objective-C - difference between alloc and allocFromZone? [closed]?

First ARC disallows calling zone on objects. Since all things are moving that way that seems a good enough reason to not use allocWithZone. There is one good use that I know of to use allocWithZone, conforming to NSCopying.

@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end And while you can ignore the zone parameter alltogether, I like to do something like: -(id)copyWithZone:(NSZone *)zone{ SampleClass *copy = SampleClass allocWithZone:zone init; copy->_myString = _myString copyWithZone:zone; return copy; } Other than that I don't think there's much more to say than is posted the previous question.

Straight from the horse's mouth: There is no need to use NSZone any more—they are ignored by the modern Objective-C runtime anyway (That's from the ARC release notes, for anyone reading this after Apple breaks their documentation structure again. ) Memory zones were somewhat useful once upon a time, but Cocoa has pretty thoroughly moved away from them. NSZone is like a vestigial tail, and both ARC and the libauto GC cut it off.As Apple engineer Bill Bumgarner pointed out in the comments on bryanmac's dupe, they were simply unwieldy and not used to great effect in Cocoa.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions