Re: Meaning of allocWithZone:NULL?
Re: Meaning of allocWithZone:NULL?
- Subject: Re: Meaning of allocWithZone:NULL?
- From: "David W. Halliday" <email@hidden>
- Date: Wed, 20 Jun 2001 07:50:23 -0500
- Organization: Latin AmeriCom, formerly Latino Online
Youngjin Kim wrote:
>
Hi,
>
I roughly understand that allocWithZone:[self zone] will use same memory
>
area with caller object. but what's the meaning of 'allocWithZone:NULL'?
>
>
The shared instance of SKTToolPaletteController in Sketch example uses
>
allocWithZone:NULL, while that of SKToolInspectorController in the same
>
example uses allocWithZone:[self zone] to create its instance. What's
>
the difference between two?
>
>
SKToolInspectorController implements dealloc method, but is never
>
actually called. In my understanding, shared instance of both objects
>
need to be released explicitly. Shouldn't SKTDrawAppDelegate need to
>
implement applicationWillTerminate method to release memory allocated by
>
both?
>
>
Youngjin
I believe you'll find that +allocWithZone:NULL is the same as the default
+alloc (no arguments), which allocates from the default zone.
David email@hidden