I think there is still some clarification necessary.

what exactly are you trying to accomplish, rather than how you are trying to do it?

would I be correct to guess that you want to create a new Person object and add it to the array?

if so you need to create the object and add it to the array

id newObjectToAdd = [theArrayController newObject];
[theArrayController addObject:newObjectToAdd];



or you can programmatically create the Person object, and add it directly to the datamodel using, say

Person *aPerson=[[[Person alloc] init] autorelease];
and then add that to the data model using the mutableArrayforKeyValue:

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

Gmail sent an email on me while I was typing. No idea what happened! :) So
please ignore the incomplete message.

I have successfully done some more bindings (they're so much fun ^_^ )

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

_______________________________________________

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