• 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 help needed (relationship programmatically)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data help needed (relationship programmatically)


  • Subject: Core Data help needed (relationship programmatically)
  • From: Ralph Manns <email@hidden>
  • Date: Tue, 19 Feb 2008 23:45:47 +0100

Core Data newbie question:

I have one entity "Category" with a property "categoryName" , a one-to- many relationship "children" and an inverse one-to-one relationship "parent".
My question: how do I add an object and set the relationship. In Apple's department-employee example is this done with:


NSMutableSet *employees;
employees = [department mutableSetValueForKey: @"employees"];
[employees addObject: newEmployee];

But there are two entities. How do I add a new employee and set the manager or directReports relationship in Apple's example?

Can someone give me a hint. Thanks.

Ralph.
_______________________________________________

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 help needed (relationship programmatically)
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • Next by Date: Re: Core Data help needed (relationship programmatically)
  • Previous by thread: Re: Core Data Performance
  • Next by thread: Re: Core Data help needed (relationship programmatically)
  • Index(es):
    • Date
    • Thread