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 6918867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:54:53+00:00 2026-05-27T09:54:53+00:00

How to obtain an ordered list of coredata managed objects via accessing them via

  • 0

How to obtain an ordered list of coredata managed objects via accessing them via a relationship?

That is:

  • have the following entities: LIST, LIST_ITEM (includes an ‘Order’ field), and ITEM.
  • assume that I have already fetched the list I want to work with
  • I can then use the coredata relationships to get the LIST_ITEMS via using the relationship: e.g. “list1.listItems”, and then for each of these LIST_ITEMS I can get the ITEM (“listItem1.item”)

But if I really just want, from the LIST, an ordered list of ITEMS from the list, based on the “Order” field in the LIST_ITEM, what is the easiest way of doing this?

  • 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-27T09:54:53+00:00Added an answer on May 27, 2026 at 9:54 am

    You can sort the items returned by the relationship using an NSSortDescriptor just as you would in a regular fetch request. For example:

    NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"order" ascending:YES] autorelease];
    NSArray *sortedListItems =  [list1.listItems sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
    

    The key method here is [NSSet sortedArrayUsingDescriptors:]

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

Sidebar

Related Questions

I would like to obtain a list of files from a git repository that
I have a table that consists of the following: food || last_order_date ------------------------- pizza
I have a query that currently returns data with the following attributes: A number
Is that possible to create an ordered list of arrays in Notepad++ using the
I have a table from which I need to obtain rows ordered by a
I have an ASP.NET repeater that is being populated via a datasource. The data
I can obtain SharedPreferences via: getSharedPreferences(someName, ...) How do I get a list of
I'm trying to obtain the machine precision on gmp variables. To that end, I
How can I obtain the friends list of a friend or follower using Twitter4J
I can't obtain the result I want, let me explain: I have two tables

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.