Re: NSTextFieldCell subclass
Re: NSTextFieldCell subclass
- Subject: Re: NSTextFieldCell subclass
- From: matt neuburg <email@hidden>
- Date: Wed, 24 Sep 2003 10:49:54 -0700
On Tue, 23 Sep 2003 22:24:37 -0400, David Schmitt <email@hidden> said:
>
All my test app does now is subclass NSTextFieldCell and override -init
>
and -dealloc to send an NSLog to indicate these methods have been
>
called. It uses a two column table, and sets the datacell of the first
>
column to this subclassed NSTextFieldCell.
>
>
The results are that -init is called once, but each and every time I
>
click in the subclassed cell, -dealloc gets called. How (and why) can
>
this be? I've looked at this for days and can't figure it out.
Aaaar, me hearty, this be because thar be more than one way to make an object, thar be. Add this to your implementation of yon NSTextFieldCell subclass:
- (id) copyWithZone: (NSZone*) zone {
NSLog(@"Copy called for object at: %p", self);
return [super copyWithZone: zone];
}
and all will be clear as Davy Jones's purest rum. m.
PS I seem to have missed National Talk Like A Pirate Day this year so I'm making up for it now.
--------
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.