• 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: The Cell from Hell (TM)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Cell from Hell (TM)


  • Subject: Re: The Cell from Hell (TM)
  • From: Jim Witte <email@hidden>
  • Date: Fri, 7 May 2004 13:38:17 -0500

If you alloc-init-autorelease an NSCell and hand it to two
NSTableViews (with setDataCell or whatever), memory management is
taken care of properly.
Not quite (at least for NSTextFieldCells). The NSCell does not retain the NSTableView (otherwise there would be a retain cycle and/or it is shared), but nevertheless keeps a reference to it which you can inspect [..] Now if last NSTableView goes away, the NSCell will die trying to be displayed in the other NSTableView (or even copied).

But if you do hand an NSCell to two NSTableViews, which view is the NSCell's reference to - or is it to both?

NSCells are indeed copyable, and apparently NSTableView do a lot of copying when you edit the cell. However not everything survives a copy -- I had some code that used copied NSCells to get around this problem, and the placeholder strings were all missing. Moreover, if you have a long menu, I suspect (but haven't confirmed) the menu gets copied too, which is non-trivial.

This (copying the cells when editing - why would a simple edit need to copy anyway?) would seem to be a drain on speed (of some magnitude), especially with long menus (if poster is indeed correct on this one). And not copying the *whole* cell (placeholder strings missing) sounds like a bug to me.

Jim
_______________________________________________
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.


References: 
 >Re: The Cell from Hell (TM) (From: Glen Low <email@hidden>)

  • Prev by Date: Re: XCode 1.2 Error when closing project/indexing
  • Next by Date: Re: Bundling frameworks within app bundle
  • Previous by thread: Re: The Cell from Hell (TM)
  • Next by thread: [ADMIN?] Non-delivery messages
  • Index(es):
    • Date
    • Thread