Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of "zone" in copyWithZone:?

I was going through "Pro. Objective-C Design Patterns for iOS" by Chung and found

_sharedSinglton = [[super allocWithZone: NULL] init];

I looked in Apple's documentation for NSCopying as well, but can't really understand what a ZONE really means.

like image 830
Prashant Rane Avatar asked Jan 16 '12 08:01

Prashant Rane


1 Answers

NSZone is obsolete now, but back in the NEXTSTEP days, NSZone was an attempt to bring the concept of "malloc zones" into Cocoa. Here are some docs that described how it worked when it was enabled: http://www.cocoadev.com/index.pl?NSZone

like image 175
StilesCrisis Avatar answered Jan 03 '23 13:01

StilesCrisis