title: Using Core Data to fetch generates 'unrecognized selector error'?
body: <p>I'm trying to retrieve a list of objects saved using Core Data. No changes where made to the default setup made by Xcode when creating the project. There are items in the actual data store, and the entity <code>Transaction</code> works fine when saving but when running the following code:</p>
  
  <pre><code>    NSManagedObjectContext * context = [[NSApp delegate] managedObjectModel];
      NSFetchRequest * fetchRequest = [[NSFetchRequest alloc] init];
      NSEntityDescription * entity = [NSEntityDescription 
                                      entityForName:@"Transaction" 
                                      inManagedObjectContext:context];
      [fetchRequest setEntity:entity];
      NSError * error = nil;
      NSArray * transactionList = [context executeFetchRequest:fetchRequest error:&amp;error];
      if (&amp;error != nil) {
          [Utility showMessage:error.description asError:YES];
      } else {
          [Utility showMessage:[NSString stringWithFormat: @"Items: %@", transactionList.count] asError:NO];
      }    
  </code></pre>
  
  <p>I receive the following error when trying to create the <code>entity</code> object.</p>
  
  <blockquote>
    <p>[NSManagedObjectModel persistentStoreCoordinator]: unrecognized selector sent to instance</p>
  </blockquote>
  
  <p>What am I missing, or what do I do to check what is causing the error?</p>
  
  <p><sub><strong>Footnotes</strong><br>
  - <code>Utility</code> is a static class which simply generates a <code>NSAlert</code> box.<br>
  - I've been using <a href="http://www.raywenderlich.com/934/core-data-tutorial-getting-started" rel="nofollow">this</a> tutorial to try and understand how the code works</sub></p>