• 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
Core Data: mutableArrayValueForKey and addObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data: mutableArrayValueForKey and addObject


  • Subject: Core Data: mutableArrayValueForKey and addObject
  • From: Luc Vandal <email@hidden>
  • Date: Tue, 03 Feb 2009 21:29:58 -0500

Hi,

A1 = customers array with a to-many relationship to invoices
A2 = invoices array with a relationship to customers

Bindings set in IB as Content Set -> Customers.selection.invoices with invoices as the model key path.

I understand that calling addObject directly is a KVO no-no and that I need to get a NSMutableArray from my array controller and alter it. But how do I know what key is related to the array? I tried calling:

NSMutableArray *a = [invoiceArrayController mutableArrayValueForKey:@"invoices"];

but I get this error:

[<NSArrayController 0x144b00> valueForUndefinedKey:]: this class is not key value coding-compliant for the key invoices.

Also tried:

NSMutableArray *a = [invoiceArrayController mutableArrayValueForKeyPath:@"Customers.selection.invoices"]; with no success.

In the documentation, it says that 'key' is the name of an ordered to- many relationship.

I did find documentation about this but it's lacking examples and I'm confused. Could anyone explain or direct me to an example? It seems that this is a common trap when starting to work with Core Data but I've yet to find something clear to figure this out!

Thanks!

Luc
_______________________________________________

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


  • Follow-Ups:
    • Re: Core Data: mutableArrayValueForKey and addObject
      • From: mmalc Crawford <email@hidden>
    • Re: Core Data: mutableArrayValueForKey and addObject
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: processName and Bundle Name -- the same?
  • Next by Date: Re: AquaticPrime Config.php + PayPal Advanced Variables Not Working
  • Previous by thread: Re: Keyword Filtering & Weekday Selection
  • Next by thread: Re: Core Data: mutableArrayValueForKey and addObject
  • Index(es):
    • Date
    • Thread