Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6027083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:32:21+00:00 2026-05-23T04:32:21+00:00

Say I have 2 managed objects in my model: Department and Employee (as discussed

  • 0

Say I have 2 managed objects in my model: Department and Employee (as discussed in the Core Data Programming Guide). If I already have a specific department retrieved, I know I can get all employees in that department through

NSSet *departmentsEmployees = aDepartment.employees;

but what if I want to find a specific employee (e.g. with employeeId = 123) in that set, change one of its attributes, then save the change? How do I do that? Can I do a targeted query on the set? Or would I have to loop through each employee to find the one I want?

It seems that it would be better to try to find it in the employees NSSet instead of doing a whole new query to the entire data model because I already have a specific department.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:32:22+00:00Added an answer on May 23, 2026 at 4:32 am

    One way to narrow the search is to use -[NSSet filteredSetUsingPredicate:].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been pondering how best to order a set of Core Data managed objects,
I have a managed class library (say mylib.dll) and a 3rd party managed app
I have a somewhat complex data model in my iPad application (an OpenGL drawing
One thing I have in mind is, that datasets in Core Data (or lets
Lets say you have a FooManager made to manage multiple objects of type Foo
Let's say I have a set of Django Models: class Article(models.Model): title = models.CharField(max_length=100,
I have a document-based Core Data application (running on Mac OS X 10.5 and
Say, I have the following conceptual model, there are strories that have tags (more
I'm using core data on an iPhone application. I have multiple persisntent stores that
Possible Duplicate: How does .net managed memory handle value types inside objects? I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.