Re: mutableArrayForKeyValue Question (ignore other email)
Re: mutableArrayForKeyValue Question (ignore other email)
- Subject: Re: mutableArrayForKeyValue Question (ignore other email)
- From: "Alex Wait" <email@hidden>
- Date: Sat, 28 Jun 2008 20:51:05 -0700
i've read most of
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSArrayController_Class/Reference/Reference.html
and I don't see what you mean. is there some "magic" key?
why isn't it Person or array?
I tried doing
[controller addObject:newObj];
[table reloadData];
and that 'worked" at least.
On Sat, Jun 28, 2008 at 8:03 PM, mmalc crawford <email@hidden> wrote:
>
> 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
>
>
--
If you can't be kind, at least have the decency to be vague.
_______________________________________________
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