• 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: Core Data getting many data from relationship.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data getting many data from relationship.


  • Subject: Re: Core Data getting many data from relationship.
  • From: Marcus Zarra <email@hidden>
  • Date: Fri, 6 Oct 2006 17:20:50 -0600

id result = [aDepertment valueForKey:@"employees"];
NSLog(@"Result is %@", [result class]);

You will probably get an NSSet back if it is a to-many relationship. The logging will confirm what you are getting back.

Marcus S. Zarra
Zarra Studios LLC
Simply Elegant Software for OS X
www.zarrastudios.com

On Oct 6, 2006, at 2:28 PM, David Alter wrote:

I think this is a very basic question and I'm just not finding the answer. I want to get the many data for a given relationship. Lets say I have a Department and I want to get all its Employees. Department has a relationship called employees. Is this what I do?

id result = [aDepertment valueForKey:@"employees"];

What do I get back? Is it an array, a set, or some other kind of container?

Should I be using mutableArrayValueForKey from NSKeyValueCoding protocal?

I have been reading the Core Data docs and all the examples show situations that return only one object.

thanks for the help

-dave


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Core Data getting many data from relationship. (From: David Alter <email@hidden>)

  • Prev by Date: cocoa MVC design question
  • Next by Date: Altering the behavior of NSUserDefaults
  • Previous by thread: Re: Core Data getting many data from relationship.
  • Next by thread: NSMiniControlSize bigger then NSSmallControlSize
  • Index(es):
    • Date
    • Thread