On Jun 28, 2008, at 7:42 PM, Alex Wait wrote:

I am trying to modify the array controller programmatically and I'm running
into problems using mutableArrayForKeyValue
I am using this line
   id proxy = [controller mutableArrayValueForKey:@"Person"];
when I do
   [proxy addObject:newPerson]
I get
[<NSArrayController 0x130050> valueForUndefinedKey:]: this class is not key
value coding-compliant for the key Person.
In IB I have bound the Content Array to my array member in App Controller.
Shouldn't this work?

No.
Just as the error states, @"Person" is not a valid key for the controller.

I have set the class name to be of the "Person" class. Right now the key I am using is "Person" but I have also tried "array" and got the same problem.

Similarly, @"array" is not a valid key for the controller.

What do I do next?

Look at the API reference for NSArrayController to see what are valid messages to send to the controller to achieve what it is that you want; read the bindings conceptual documentation to see how else you might achieve this by modifying the source data controller; or look at the myriad online examples that illustrate this.

mmalc

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to