• 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: mutableArrayForKeyValue Question (ignore other email)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mutableArrayForKeyValue Question (ignore other email)


  • Subject: Re: mutableArrayForKeyValue Question (ignore other email)
  • From: Scott Anguish <email@hidden>
  • Date: Sun, 29 Jun 2008 02:58:24 -0400

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 (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


References: 
 >mutableArrayForKeyValue Question (ignore other email) (From: "Alex Wait" <email@hidden>)

  • Prev by Date: Re: Methods that return autoreleased objects?
  • Next by Date: Re: Why aren't my bindings firing?
  • Previous by thread: Re: mutableArrayForKeyValue Question (ignore other email)
  • Next by thread: Re: mutableArrayForKeyValue Question (ignore other email)
  • Index(es):
    • Date
    • Thread