• 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: Custom cell with Bindings having strange prints in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom cell with Bindings having strange prints in NSTableView


  • Subject: Re: Custom cell with Bindings having strange prints in NSTableView
  • From: "Kyle Sluder" <email@hidden>
  • Date: Thu, 28 Feb 2008 04:06:12 -0500

On Wed, Feb 27, 2008 at 8:55 AM, Miguel Coxo <email@hidden> wrote:
> Hello, i have a binding setup in IB like this:
>
>  http://mt15.quickshareit.com/share/picture1f06b0.png
>
>  where the cellData is a function in the class CPDownload:
>
>  - (id) cellData
>  {
>  return self;
>  }

This means [[foo cellData] description] is going to return the default
text of the form "<ClassName 0x12345678>".  You want to bind the cell
to either a property or to the object itself and use a value
transformer.  Overriding draw methods to display this data is usually
unnecessary, unless perhaps you are doing something out of the
ordinary in your drawing (since you're discussing downloads, perhaps
you are... maybe drawing a progress bar or somesuch).

>  Then there is the CPDownloadQueue that has a NSArray with CPDownloads, and
>  updates them like this:
>
>  self.downloads = [downloads arrayByAddingObject: download];

Don't do this; you're wiping out the observed NSArray from underneath
the column's feet (bindings are accomplished through KVO).  You want
to do this instead:

[[self mutableArrayValueForKey:@"downloads"] addObject:download]

--Kyle Sluder
_______________________________________________

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: 
 >Custom cell with Bindings having strange prints in NSTableView (From: "Miguel Coxo" <email@hidden>)

  • Prev by Date: Re: Spotlight Importer
  • Next by Date: NSButton setStringValue
  • Previous by thread: Re: Custom cell with Bindings having strange prints in NSTableView
  • Next by thread: Scaled CATextLayer
  • Index(es):
    • Date
    • Thread