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

  • Home
  • SEARCH
  • 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 6116883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:15:27+00:00 2026-05-23T15:15:27+00:00

I have a strange error in my app, which says: * Terminating app due

  • 0

I have a strange error in my app, which says:

* Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘+entityForName: could not locate an NSManagedObjectModel for entity name ‘Book’

I know, there are hundrets of “Could not locate an NSManagedObjectModel for entity name” topis here and on the web, but the strange thing is, it’s a universal app and the iphone app always works fine, only the ipad app is crashing on startup.

In the main AppDelegate, there is some code in two methodes and in the iphone / ipad AppDelegate I’m calling this code in applicationdidFinishLaunchingWithOptions like this:

    if ([self modelExists] == NO) {
    [self buildModel];
}

So it’s the same way I call the code, but the ipad version crashes and the iphone version does not.

The only different is that the iPhone version uses a TabBarContoller (set up in IB) and the iPad version uses a single viewController (also set up in IB).

It happens on both, simulator and device.

I have no idea what to do. Hope you can understand what I mean …
Thx a lot
Sebastian

EDIT:
I found out, when I run the iPhone Version, the code in the main AppDelegate is called as it should be, but when I run the iPad Version NONE code of the main appDelegate is called at all, so there is no managedObject created and that’s the reason for the error. But why is no code run in the main AppDelegate ? Thx

EDIT2:
This is the code in my main AppDelegate now:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([self modelExists] == NO) { // Checks if the model is allready filled up or not. (Uses  CoreData stuff of course)
// iPhone Version is fine here. iPad Version crashes.
    [self buildModel];
}    

[self buildInterface]; // Called in the iPhone or iPad AppDelegate to make the window visible etc.
return YES;
}

So didFinishLaunchingWithOptions is called in the iphone and in the ipad version. The iPad version just doesn’t run the coredata stuff anyway, whereas the iphone version does run the coredata stuff as it should. Any idea what could be wrong? THX!

  • 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-23T15:15:27+00:00Added an answer on May 23, 2026 at 3:15 pm

    I found my problem. Really strange …

    It was the code of “modelExists”

    - (BOOL)modelExists {
    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    request.entity = [NSEntityDescription entityForName:@"Book" inManagedObjectContext:__managedObjectContext]; //<- Crashed. Had to change it to self.managedObjectContext
    request.predicate = nil;
    NSError *error = nil;
    ...
    

    Sebastian

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

Sidebar

Related Questions

I have a strange problem in my android app. I have an activity which
I have a strange timeout error, but I'm not sure how to debug it.
I have a strange error where my jquery ajax request doesn't submit all the
I am getting a strange error using jQuery 1.3.2 and Firefox. I have created
I have an application where every now and then I'm getting a strange error.
it is very strange, because this error doesn't happen all the time... I have
I have an Erlang app which makes a large number of http calls to
I have few variables which are used system-wide in my rails app. It runs
I have an app on the store which was built for 3.1.2, but which
I have a very strange issue with Daylight Savings Time (DST) in my app.

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.