Re: NSTableView doesn't show data until I click on a header
Re: NSTableView doesn't show data until I click on a header
- Subject: Re: NSTableView doesn't show data until I click on a header
- From: Quincey Morris <email@hidden>
- Date: Mon, 30 Apr 2012 09:40:36 -0700
On Apr 30, 2012, at 09:27 , Koen van der Drift wrote:
> I am using an NSMutableArray to store the myObjects, the table
> displays several properties of each object in seperate columns. So
> the order in which the objects are stored in the array is not
> critical, they will be ordered once displayed in the table and the
> user can select which column to use for ordering. Therefore I don't
> think I need to use the 'indexed mutable accessors', but the 'mutable
> unordered accessors' as discussed in the same link from mmalc. Am I
> correct here?
No, you have to use the indexed accessors, because the NSArrayController that mediates between your data model and your UI (NSTableView) expects the property to be indexed -- i.e. to behave like an array -- even though the contents get re-sorted before display.
[Confusingly, this is only true when you're using an array controller in "Class" (normal) mode. When you're using an array controller in "Entity" (Core Data) mode, it expects the property to be unordered, since that how Core Data to-many properties are modeled. Of course, in this case, you're not implementing the accessors yourself.]
_______________________________________________
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