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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:54:05+00:00 2026-06-10T13:54:05+00:00

The question here is that is it a good choice to make a linkedlist

  • 0

The question here is that is it a good choice to make a linkedlist to maintain the order/priority while using coredata or should one just use a simple var to maintain the priority as a number.

While maintaining a number if a new object is inserted in an array of N objects at N/2 position then all the priority values for objects from N/2+1 -> N/2 will have to be modified which will result in that many sql queries if I am not mistaken.

If there is a linkedlist then a self relationship can be maintained to that entity say “next”. If an object is inserted at N/2 position there are just two queries which is :
1. N/2-1 -> next -> newObj
2. newObj -> next ->N/2+1
But here the problem lies in using the NSFetchedResultsController which cannot sort the fetchedresults using this relationship or can it in someway?

Please respond which one of the two techniques is better in relevance to the situations mentioned above.

  • 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-10T13:54:06+00:00Added an answer on June 10, 2026 at 1:54 pm

    The best solution would be to use a ordered to-many relationship. This uses an NSOrderedSet which keeps the ordering like an array but also supports fast membership tests like a set. This only is available on iOS 5.0 or Mac OS X 10.7 or later though.

    If I needed to support earlier versions of iOS I’d chose the approach with an extra property for the ordering. This makes fetches much easier. A linked list structure might be easier to update, but usually fetching (for displaying the data) is done much more often, so this is the case that should be easier.

    If you need to update your ordering very often you can leave big gaps between your ordering numbers.

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

Sidebar

Related Questions

this is my first question here :) I know that I should not check
While answering to a question about that here: https://stackoverflow.com/a/9872630/82609 I tried to do the
Sort of a methods/best practices question here that I am sure has been addressed,
Basic question here - I have many lines of code that look something like:
The question here is: If a thread that acquiring an exclusive lock to an
First question here: it is a very short yet fundamental thing in Java that
I asked a question here about an Linq error that results from mixing Linq-To-SQL
I am asking this question here because it is my understanding that this is
C# question here.. I have a UTF-8 string that is being interpreted by a
I see this question here on SO but I am not sure that answers

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.