FROM : Bill Bumgarner
DATE : Sun Feb 17 21:06:22 2008
On Feb 17, 2008, at 11:15 AM, Gregory Weston wrote:
> See what you're saying? +alloc *or* +allocWithZone:.
>
> See the subject? +alloc. It does not say anything about
> +allocWithZone:.
>
> See this code?
>
> @interface MyTest : NSObject
> @end
>
> @implementation MyTest
> + (id)alloc
> {
> NSLog(@"allocating");
> return [super alloc];
> }
> @end
You would have to override +allocWithZone: to have any kind of
reliable behavior. +alloc is a cover for +allocWithZone: with a NULL
zone. Not that you would know that from the documentation,
unfortunately.
Without assuming anything, you would have to override both allocator
methods; +alloc and +allocWithZone:.
b.bum
DATE : Sun Feb 17 21:06:22 2008
On Feb 17, 2008, at 11:15 AM, Gregory Weston wrote:
> See what you're saying? +alloc *or* +allocWithZone:.
>
> See the subject? +alloc. It does not say anything about
> +allocWithZone:.
>
> See this code?
>
> @interface MyTest : NSObject
> @end
>
> @implementation MyTest
> + (id)alloc
> {
> NSLog(@"allocating");
> return [super alloc];
> }
> @end
You would have to override +allocWithZone: to have any kind of
reliable behavior. +alloc is a cover for +allocWithZone: with a NULL
zone. Not that you would know that from the documentation,
unfortunately.
Without assuming anything, you would have to override both allocator
methods; +alloc and +allocWithZone:.
b.bum






Cocoa mail archive

