• 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 does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)


  • Subject: How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
  • From: email@hidden
  • Date: Sat, 25 Feb 2006 08:33:14 -0800

Simple question.

If I have a binding like contentArray in an NSArrayController which is bound to an object that returns an array, if the key is not arrangedObjects (in the controller key binding),
the controller treats the returned array like its just one object. NSTableColumn does the same thing.


This is strange, shouldn't NSArrayController's contentArray explicitly know its getting an array, so each item is procured and managed by it?
Not as a single object. In my case, the array controller keeps reporting its count as 1 (that item being the array that should be its content).


I'm becomeing increasingly frustrated by this.
According to this: http://www.cocoadev.com/index.pl?NSArrayController

Notably:

"Problem is that there are private objects communicating (like NSBinder?, NSTableBinder?) which seem to get the row values for the table column. The controller itself gets asked only for the "arrangedObjects" key path. You cannot override NSArrayController valueForKeyPath method and return your value for e.g. "arrangedObjects.indexInContentArray"."

This is exactly what I've been encountering.
Does *anyone* know how to get an array into a table column or NSArrayController using a plain array or array indexed accessors?
I've tried even calling my array "arrangedObjects" hoping to trick the thing, but it doesn't work.........


Chiao,

Andre
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
      • From: Camillo Lugaresi <email@hidden>
  • Prev by Date: Re: Send key commands to other window...
  • Next by Date: Re: programmatically enable script menu
  • Previous by thread: Re: How to Implement Finder - Search like functionality in my App
  • Next by thread: Re: How does a binding know what it gets should be treated like an NSArray or not ? (Was: How to observe and bind (KVO/KVB) to a value generated at runtime..)
  • Index(es):
    • Date
    • Thread