• 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: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?


  • Subject: Re: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 26 Feb 2010 12:24:25 -0800

On Feb 26, 2010, at 11:07 AM, Sean McBride wrote:

> There seems to be something 'special' about the various mouse tracking
> methods.  It seems that if I change my cell's objectValue outside of the
> mouse tracking methods, that the TableView does not pay attention (and
> does not update my model).

This is pretty much by design. There isn't a cell instance per table cell; instead there's only one per column and it's repeatedly called to draw every row in that column. This allows the table view to scale to huge numbers of rows. So while your cell is being told to do something (like start tracking) the table knows what row it's being used for at that moment; but later on there's no specific mapping to any particular row.

If you want your cell code to be able to update the model at arbitrary times, you'll need to call into your own model code to change the data (and then inform the table view that the value changed.)

—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSTableView ignores changes to cell's objectValue outside mouse tracking methods? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Layer-backed view issue with isOpaque
  • Next by Date: Re: Improving the User Experience for First Use of Downloadable Software
  • Previous by thread: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?
  • Next by thread: Re: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?
  • Index(es):
    • Date
    • Thread