• 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
How To retrieve the Relationsships from an entity in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How To retrieve the Relationsships from an entity in Core Data


  • Subject: How To retrieve the Relationsships from an entity in Core Data
  • From: Janakiram <email@hidden>
  • Date: Fri, 16 Dec 2005 13:11:46 +0530

Hi,
I am a new bie to core data. I have two entities names employee & department. I have a relation, in employee , named departments which specifies the departments in which the employee works. I can create employees & departments.But i am unable to retrieve the employees who r having salaries greater than $10,000 present in a given department. I don't have a relationsship from department to employee. I think , i am probably missing the predicate for the fetch request. Below is the Code for the fetch request.


NSEntityDescription *entity = [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:managedObjectContext];
NSFetchRequest *aRequest = [[NSFetchRequest alloc] init];
[aRequest setEntity:entity];
[aRequest setPredicate:[NSPredicate predicateWithFormat:@"salary >= %f and departments.DeptID == %@ ",10000.0,2]]; // where dept id is 2.
NSError *error = nil;
NSArray *headerFooterSettingsResult = [context executeFetchRequest:aRequest error:&error];

Please help me to solve this. Thanks in Advance.

-JanakiRam.
_______________________________________________
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
  • Follow-Ups:
    • Re: How To retrieve the Relationsships from an entity in Core Data
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Interface Builder Outlets
  • Next by Date: Re: How To retrieve the Relationsships from an entity in Core Data
  • Previous by thread: Re: A Newbie Float Problem
  • Next by thread: Re: How To retrieve the Relationsships from an entity in Core Data
  • Index(es):
    • Date
    • Thread