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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:57:00+00:00 2026-05-23T17:57:00+00:00

I have 3 tables in my core data tables. Item table : items, which

  • 0

I have 3 tables in my core data tables.
Item table: items, which has an ID column and a connection to a properties table.
Properties table: it has a propertyValue column and a connection to item table and a connection to property table.
Property table: it has a propertyName column and a connection to properties table.

The property table contains a propertyName called “price”.
The properties table contains a propertyValue “20” for the property “price”.
Do you think I can sort the Items table by price?

I am using a NSFetchedResultsController and I am creating a NSFetchRequest for it.
I have tried to write a NSSortDescriptor with a comparator block object for the NSFetchRequest. It isn’t working. After this I tried to write a NSSortDescriptor without any selector or block object, I just setup a key called “dealPrice” and created a category on the Item managed object with a method called - (NSString *)dealPrice. It wasn’t working neither.

Do you know any other method? Or do you know the solution?

  • 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-23T17:57:01+00:00Added an answer on May 23, 2026 at 5:57 pm

    You’ve obviously got a bad case of SQL fever. Your trying to treat Core Data like an SQL wrapper and that is messing everything up.

    Core Data is not SQL. Entities are not tables. Objects are not rows. Attributes are not columns. Relationships are not joins. Core Data is an object graph management system that may or may not persist the object graph and may or may not use SQL far behind the scenes to do so. Trying to think of Core Data in SQL terms will cause you to completely misunderstand Core Data and result in much grief and wasted time.

    A Core Data datamodel should not be configured depending on the needs of the UI or any other non-data requirement. Instead, it should accurately model/simulate the real world objects, events or conditions that the app deals with.

    In this case, you are modeling:

    1. A type of property that has a name and a price.
    2. An item denoted by an id of some kind
    3. A relationship between one or more particular property instances and one or more instances of item.

    Therefore, your data model only needs two entities connected by a relationship. You don’t need a “join” because the relationship handles the connection between the two entities automatically.

    The simplest model has just a one-to-one relationship:

    Item{
      id:string
      property<-->Property.item
    }
    
    Property{
      name:string
      price:number
      item<-->Item.property
    }
    

    If each Item object can have several associated Property objects then you would have:

    Item{
      id:string
      properties<-->>Property.item
    }
    
    Property{
      name:string
      price:number
      item<<-->Item.properties
    }
    

    If each Property object can have several associated Item objects:

    Item{
      id:string
      property<<-->Property.items
    }
    
    Property{
      name:string
      price:number
      items<-->>Item.properties
    }
    

    How you configure your sort descriptors depends on the details of the relationships and which entity’s objects your tableview will display.

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

Sidebar

Related Questions

I have one table in my core data source which holds some articles with
I have several tables whose only unique data is a uniqueidentifier (a Guid) column.
I have a delete statement that's going against one of my core application tables.
In my database I have tables that define types for example Table: Publication Types
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables tag , page , pagetag With the data below page
I have two tables that are joined together. A has many B Normally you
I'm working on an table drill-down style iPhone app that has prepopulated data. I
I have been building a core data application to administrate some data and I've
i have an application which uses CoreData/.sqlite to store my data, a tab bar

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.