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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:34:04+00:00 2026-06-03T22:34:04+00:00

I have a list of tasks within Core Data. I fetch them into a

  • 0

I have a list of tasks within Core Data. I fetch them into a UITableView using an NSFetchedResultsController.

I need custom sections in a custom order:

  1. OVERDUE
  2. ACTIVE
  3. ONGOING
  4. POSTPONED
  5. COMPLETED

To determine what section a task should go in I use a derived transient attribute calculated on the fly based on other attributes in the relative object.

Unfortunately you cannot pass a derived value as a sort descriptor used by a fetch request. This is because a fetch relies on already having data it is being asked to fetch. Chicken & Egg.

I understand why I can’t do it, that doesn’t help me solve the problem!

I’ve tried:

  • Subclassing NSFetchedResultsController to ‘customise creation of
    sections and index titles
    ‘. Maybe I’m doing this wrong however this just changes the names and orders of sections, not how many things go in those sections (which is critical).

  • Populating arrays per section and feeding them to the table (clunky,
    slow yet fully works).

  • Ripping out ongoing & postponed tasks (which works, but isn’t ideal). This way I can sort by dueDate and drive the sectionNameKeyPath via the transient values.

Does anyone have any better ideas? There are quite a few questions already just like this one yet none of them come to a neat solution.

Thanks in advance!

Cheers

  • 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-06-03T22:34:05+00:00Added an answer on June 3, 2026 at 10:34 pm

    The simplest solution is to add a persistent ‘section’ attribute (or convert your existing transient attribute). Make it a set of sortable values (which you display at runtime using the names you want). Whenever you update any record, recompute and store the section attribute as well.

    I realize this sounds like you’re storing redundant information but besides making your logic simpler, it will also be indexable which will speed access.

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

Sidebar

Related Questions

I have a basic GridView that displays a list of tasks to do (just
I have a list of tasks that I allow a user to sort, currently
I have a list of tasks that sorted by the due date. When I
I am trying to process some tasks asynchronously using Rx, e.g. var list =
I have a service running, and one of its tasks is to regularly fetch
I have a List of Tasks that a user can preform. Each one will
Possible Duplicate: nullPointerException in multi column list I have following app which fetches data
I have a List<KeyValuePair<double, double>> , the list is sorted by KeyValuePair.Key , so
I have a script that parses an html page for all the links within
I have the following task: Query SOLR and return a weighted list based on

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.