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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:13:22+00:00 2026-05-16T17:13:22+00:00

I have a simple entity called Store built in Xcode’s data modeler for use

  • 0

I have a simple entity called “Store” built in Xcode’s data modeler for use in an iPhone application. I also have a class (Store) associated with it and I’ve been able to store and retrieve data using CoreData without any problems.

Now I realized that I want to have a relationship to another entity (Aisle). There is already a one-to-one relationship from Aisle to Store, but since there can be multiple Aisles in one Store, I tried to add the reverse. The new relationship is one-to-many, the inverse of the original one-to-one relationship, optional, and has delete set to cascade. I also recreated the associated Store class so that there is now an NSSet ivar in the class definition as well.

Just adding this relationship causes my existing data to be irretrievable through NSFetchRequest. As I’m debugging I see that the array that is being populated by the request contains zero items, but looking at the SQL database I see that the objects are all there. If I remove the new relationship everything works just fine.

Here is my code to retrieve the data:

NSManagedObjectContext *context = [self managedObjectContext];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Store" inManagedObjectContext:context];

[fetchRequest setEntity:entity];

NSError *error;
NSArray *storesList = [context executeFetchRequest:fetchRequest error:&error];

[fetchRequest release];

Any idea why my fetch isn’t working correctly?

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-16T17:13:22+00:00Added an answer on May 16, 2026 at 5:13 pm

    Have you deleted the sqllite file and recreated the DB and repopulated it after the change in the model? If not, you may want to consider this.

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

Sidebar

Related Questions

I have a rather simple data model, but I have a centric entity called
I have a simple core-data entity that has a Boolean attribute called subscribedToNewsletter .
I'm new to entity frame work code first. I have simple class called Cat
I have a number of simple controller classes that use Doctrine's entity manager to
I have a simple table called News . I'm using Entity Framework to generate
Problem I have a @MappedSuperclass called Data as the parent of every Entity in
I have a simple base entity type called EntityBase that implements IEquatable<EntityBase>. I've used
I have a simple class called Applicant. I'm trying to add a template controller
In my game I created a base class called Entity which I store in
I have a simple Coredata model with one entity called conversation and the other

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.