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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:13:46+00:00 2026-06-07T16:13:46+00:00

Hi I am a begginer with IOS and have created my first core data

  • 0

Hi I am a begginer with IOS and have created my first core data app. I have created my modal and included it in the project. It does contain the entity ‘Client’. When I use the following test code to create the database and attempt to add a Entity I get the following error

..’+entityForName: could not locate an NSManagedObjectModel for entity name ‘ItemMake”

when calling [NSEntityDescription insertNewObjectForEntityForName:@”Client” inManagedObjectContext:contxt];

I have checked everything I can think off, the code is shown below. This is some further information…

a) mdl and contxt are not nil.

b) database file is created in the simulator (16kb)

c) accessing the database from another tool shows only two tables which appear to be SQLlite system tables

d) The package does contain a ‘EasyOrder.momd’ directory and a ‘EasyOrder.mom’ file. The app is called ‘EasyOrder’.

e) The project contains a ‘EasyOrder.xcdatamodeld’ file which has a Client entity (among others) defined.

f) I have tried other enities in my database with the same results

g) My was a standard app that I added core data support too. I am not using default code in the app delegate, but my examples do not either.

Code as follows

NSManagedObjectContext *contxt;
NSManagedObjectModel *mdl;
NSPersistentStoreCoordinator *ps;

mdl = [NSManagedObjectModel mergedModelFromBundles:nil];
ps = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mdl];


NSArray *documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);                

NSString *docDir = [documentDirectories objectAtIndex:0];

NSString *dbLoc = [docDir stringByAppendingPathComponent:@"test.sqllite"];

NSURL *databaseUrl = [NSURL fileURLWithPath:dbLoc];

NSError *err;

if ([ps addPersistentStoreWithType:NSSQLiteStoreType
                     configuration:nil 
                               URL:databaseUrl 
                           options:nil 
                             error:&err] == false) {
    NSLog(@"%@", err);
}

[contxt setUndoManager:nil];



//Add record

//CRASHES HERE !

Client *c = [NSEntityDescription insertNewObjectForEntityForName:@"Client" inManagedObjectContext:contxt];


[c setEntityRef:1234];

….

tia
Rob

  • 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-07T16:13:48+00:00Added an answer on June 7, 2026 at 4:13 pm

    I have just solved the issue. I believe there was some sort of versioning problem where the data model being used was old and contained no tables.

    I created a test app with a dummy model (just one table) and it worked fine. I then removed that model and used the one from my actual application. It continued to work fine but did not created the tables as per the data model. So I removed the run time from the simulator and it then properly created all tables.

    I followed the same process in my actual app, removed from simulator, removed model, added model with a different name and re built. App now works !

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

Sidebar

Related Questions

Begginer Running rails 3.2.2, Ruby 1.8.7 I have 2 models, a Hotel (created by
I am a begginer in android,here I have activity that use web service: SoapObject
I'm begginer in asp.net mvc and i have some doubts. P.S: I'm using DDD
I'm in my first time with DDD, so I'm begginer! So, let's take it's
My project is being migrated from n-tier to MVC3. I have a Calendar control
I'm making an iOS app - real-time game, wanna use UDP protocol. I'm searching
i am begginer to jquery and have a simple problem.. I want to make
Suppose I have a plain text file with the following data: DataSetOne <br />
so im learning php (begginer if you cant tell) and, im currently pushin/pulling data
I'm quite a begginer and I have two tables: product and product attributes. Here's

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.