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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:32:44+00:00 2026-05-25T20:32:44+00:00

I developed an application targeted for iPhone and it uses CoreData. All is working

  • 0

I developed an application targeted for iPhone and it uses CoreData. All is working ok when I run it on the simulator, but when I run it on the device I’m getting the following error:

"*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request must have an entity.'"

I have specified and defined an entity in my code as follows:

NSFetchRequest *select = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"NewsStand" inManagedObjectContext:[CDHelper sharedCDHelper].managedObjectContext];
[select setEntity:entity];
NSError *error;
NSMutableArray *results = [[[CDHelper sharedCDHelper].managedObjectContext executeFetchRequest:select error:&error] mutableCopy];

The error occurs when I execute the fetch to show in a tableView what has stored the DB.

I also have defined a managedObjectModel:

- (NSManagedObjectModel *)managedObjectModel
 {
if (__managedObjectModel != nil)
{
    return __managedObjectModel;
}
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"newsStandModel" withExtension:@"momd"];
__managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];    
return __managedObjectModel;
}
  • 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-25T20:32:44+00:00Added an answer on May 25, 2026 at 8:32 pm

    When you load the managed object model what do you specify as the model file name? (something .mom).

    The simulator is not case sensitive, the device is. i.e.

    if the file is called MyModel.mom then

    NSString *path = [NSBundle mainBundle] pathForResource:@"mymodel" type:@"mom"];
    NSURL *url = [NSURL fileURLWithString:string];
    myModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:url];
    

    works on the simulator but not on the device.

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

Sidebar

Related Questions

I've developed an application at working using MySQL 5, that uses Views to access
I developed application on 1.6.in manifest i gave: <uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4/>. When I run
I had developed an application in visual Studio 2005. whenever i run that application
i developed application with map service and webservices when i run application its became
By Web Application I mean a web site targeted at Safari on the iPhone
I have developed application for iPhone OS 2.0. Will I be able to submit
We developed an application that uses Excel interop libraries (Microsoft.Office.Interop.Excel) to read some Excel
Am developed one application .The UI get varying differently in emulator and device.the correct
I've developed application which uses PayPal Adaptive Payments and for the Preapproval call I
I've developed application for the original iPhone, the 3G and the 3GS, now I

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.