Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Data & UIManagedDocument in Xcode 4.3: Can't merge models
    primarykey
    data
    text
    <p>I'd like to thank all the people that contribute to this website. I am one h*ll of a noob at programming and you all help me out so much. With that said, let's get on with my latest problem!</p> <p>I am creating an app that uses a <code>UIManagedDocument</code> to store a Core Data model for me. I use to create the <code>UIManagedDocument</code> with the following code, but now with Xcode 4.3.2 (The one that updates with the Mac App Store) I have an issue.</p> <p>Here's the code:</p> <pre><code> NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; url = [url URLByAppendingPathComponent:@"MyFile"]; NSLog(@"\n\n This line does print. \n\n"); UIManagedDocument *document = [[UIManagedDocument alloc] initWithFileURL:url]; NSLog(@"\n\n This line does not print \n\n"); </code></pre> <p>I receive an error in the console that goes like this:</p> <p><strong>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't merge models with two different entities named 'Foo''</strong></p> <p>Here's the thing, I'm not trying to get versions or anything like that to work. I'm simply creating a data model with two types of entities, and trying to get a UIManagedDocument to open in my app: super simple, right?</p> <p>I have uninstalled Xcode and reinstalled it to no luck. I have also deleted my Core Data Model and redone it from scratch with no luck.</p> <p>I am completely lost and have already spent about 2 nights trying to troubleshoot this.</p> <p>Help me! Please! Thanks for reading. If you need anymore information let me know. I'll give you my soul for an answer...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload