• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextFieldCell subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell subclass


  • Subject: Re: NSTextFieldCell subclass
  • From: David Schmitt <email@hidden>
  • Date: Wed, 24 Sep 2003 15:35:57 -0400

Aye, I was steered to tha' copyWithZone: method by another lad earlier in tha day. "Blow me down!" was all I could muster. Me subclass be workin' now.

Best to ya,
David

p.s. I have a 4-year-old son so every day is talk like a pirate day. Aaaar!

On Wednesday, September 24, 2003, at 01:49 PM, matt neuburg wrote:

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.

  • Prev by Date: Re: Notification Issue
  • Next by Date: Re: Subclassing NSNotificationCenter
  • Previous by thread: Re: NSTextFieldCell subclass
  • Next by thread: Sending HTML with NSMailDelivery
  • Index(es):
    • Date
    • Thread