Re: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?
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