Re: How can I populate certain table-columns with image cells while using NSArrayController?
Re: How can I populate certain table-columns with image cells while using NSArrayController?
- Subject: Re: How can I populate certain table-columns with image cells while using NSArrayController?
- From: "Michael A. Crawford" <email@hidden>
- Date: Fri, 15 Jan 2010 14:06:33 -0500
Thank you for the article.
-Michael
On Jan 15, 2010, at 12:54 PM, Arun wrote:
> You can find a beautiful article on the same @ http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/
>
> HTH
> -Arun KA
>
> On Fri, Jan 15, 2010 at 11:20 PM, Michael A. Crawford <email@hidden> wrote:
> Consider an NSTableView instance populated with data from an NSArrayController, which is bound to a content array containing instances of class foo. All of class foo's properties return BOOL and NSString values. The two BOOL values need to be shown in the table using icon images.
>
> Should the images be properties of class foo, which are bound by the array-controller, in order for them to show up in the table?
>
> Normally, when not using NSArrayController, I would make my controller the data-source for the table. When the -[tableView:objectValueForTableColumn:row:] method is called for the BOOL columns, I would return an NSImageCell. I was assuming that I cannot do this while using bindings and the NSArrayController. However, when I coded it up, I got the callbacks even though the table was bound to the array-controller
>
> Is this the correct way to do this? I'm worried that using both the DataSource callbacks and bindings to an array-controller might not be what Apple had in mind and will lead to unforeseen issues.
>
> Is there a better way?
>
> -Michael
> _______________________________________________
>
> 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
>
_______________________________________________
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