• 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: 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]

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..)


  • Subject: 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>
  • Date: Sun, 26 Feb 2006 15:06:49 +0100

On 26/feb/06, at 06:43, Andre wrote:
On 2006/02/25, at 15:07, Camillo Lugaresi wrote:

On 25/feb/06, at 17:33, email@hidden wrote:

Does *anyone* know how to get an array into a table column or NSArrayController using a plain array or array indexed accessors?

Use the contentArray binding or the setContent method of NSArrayController.
Ok, yes this works, I don't know why I was having problems before. I was binding contentArray to an object with indexed accessors, for some bizarre reason it wasn't working right...
In any case, the main problem I'm still having is that if each column is bound to a different base key path (even if the same controller), then the second column doesn't know what to do
with the array its given and just prints the description of the array..... this is the main problem I'm having. So I can't seem to convince the table column to pull the items out into each row...


To exemplify here's some pics of the problem:

http://homepage.mac.com/son_gohan/Pic3.png
http://homepage.mac.com/son_gohan/Pic4.png

A table view is supposed to display the attributes of the items of a list: each row is an item and each column is an attribute. If you bind columns to different arrays, the table view can't tell if two attributes belong to the same object, ie it can't tell which how to group cells from different columns into a single row. So don't do that: bind all columns through arrangedObjects instead.


In general, it looks like you're making things harder for you than they should be. It's not obvious why you would need a custom array controller for that UI. This site has several examples of the recommended way to do things: <http://homepage.mac.com/mmalc/ CocoaExamples/controllers.html>

Camillo
_______________________________________________
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


References: 
 >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)
 >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>)
 >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: Andre <email@hidden>)

  • Prev by Date: Objective-C in a Time Constraint Thread
  • Next by Date: Changing truncating mode for NSWindow Title
  • Previous 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..)
  • Next by thread: Fwd: 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