Bindings for dictionaries inside of an array
Bindings for dictionaries inside of an array
- Subject: Bindings for dictionaries inside of an array
- From: Lance Braud <email@hidden>
- Date: Thu, 30 Jul 2009 12:40:25 -0700
I am trying to create a master-detail view of Skim notes. Skim is a
pdf reader that let's you take notes on the pdf. The authors provide a
cocoa framework that lets me access the notes in the pdf. When I
request the notes, I am given an NSArray of notes, each note is an
NSDictionary containing 6 values:
bounds,
contents,
quadrilateralPoints,
type,
pageIndex,
color
I have created an AppController class which provides this array as an
instance variable (skimNotes); it is KV compliant using @property and
@synthesize. I bound this to an array controller, and bound the array
controller to a table in my interface. When run, the table has a
number of blank entries equal to the skim notes in the document, so I
think that is working.
Now, how do I create a detail relationship in a new table? When I
select a note in the first table, I want the dictionary values for
that note to show up in a second table.
I have tried making the second table bind to the array controller's
"Controller Key" using "selection," and binding "Model Key Path" to
"key," but that throws the following exception:
*** Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<AppController 0x135f50> valueForUndefinedKey:]: this class
is not key value coding-compliant for the key skimNotes.key.'
Using "key" works when it is a dictionary by itself, so now I'm at a
loss at how to refer to it. Thank you in advance for the help.
Lance
_______________________________________________
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