• 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
How can I populate certain table-columns with image cells while using NSArrayController?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I populate certain table-columns with image cells while using NSArrayController?


  • Subject: How can I populate certain table-columns with image cells while using NSArrayController?
  • From: "Michael A. Crawford" <email@hidden>
  • Date: Fri, 15 Jan 2010 12:50:04 -0500

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

  • Follow-Ups:
    • Re: How can I populate certain table-columns with image cells while using NSArrayController?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Core Video CIFilters/ playback / compression suggestions?
  • Next by Date: Re: Scrolling
  • Previous by thread: Re: Scrolling [SOLVED]
  • Next by thread: Re: How can I populate certain table-columns with image cells while using NSArrayController?
  • Index(es):
    • Date
    • Thread