title: error +entityForName: could not locate an NSManagedObjectModel for entity name 'Savedata''
body: <p>this is my delegate.m </p>
  
  <pre><code>#import "TestSaveDataAppDelegate.h"
  
  #import "TestSaveDataViewController.h"
  
  @implementation TestSaveDataAppDelegate
  
  @synthesize window = _window;
  @synthesize viewController = _viewController;
  @synthesize managedObjectContext = __managedObjectContext;
  @synthesize managedObjectModel = __managedObjectModel;
  @synthesize persistentStoreCoordinator = __persistentStoreCoordinator;
  </code></pre>
  
  <p>This is my NSManagedObjectContext</p>
  
  <pre><code>- (NSManagedObjectContext *)managedObjectContext
  {
      if (__managedObjectContext != nil) {
          return __managedObjectContext;
      }
  
      NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
      if (coordinator != nil) {
          __managedObjectContext = [[NSManagedObjectContext alloc] init];
          [__managedObjectContext setPersistentStoreCoordinator:coordinator];
      }
      return __managedObjectContext;
  }
  </code></pre>
  
  <p>This is my NSManagedObjectModel</p>
  
  <pre><code>- (NSManagedObjectModel *)managedObjectModel
  {
      if (__managedObjectModel != nil) {
          return __managedObjectModel;
      }    
      __managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
      return __managedObjectModel;
  }
  </code></pre>
  
  <p>This is my NSPersistentStoreCoordinator</p>
  
  <pre><code>- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
  {
      if (__persistentStoreCoordinator != nil) {
          return __persistentStoreCoordinator;
      }
  
      NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"SaveData.sqlite"];
  
      NSError *error = nil;
      __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
      if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&amp;error]) {
          NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
          abort();
      }    
      return __persistentStoreCoordinator;
  }
  </code></pre>
  
  <p>In my TestSaveDataViewController.h i import my Savedata.h exactly name like inside my Model.xcdatamodeld with entity name is Savedata, attribute inside here is saveslot1 with string type.</p>
  
  <p>in my TestSaveDataViewController.m</p>
  
  <p>@synthesize managedObjectContext;</p>
  
  <p>i have a button like this</p>
  
  <pre><code>- (IBAction)button1:(id)sender
  {
      // save text in textfield
      Savedata *savedata = (Savedata *)[NSEntityDescription insertNewObjectForEntityForName:@"Savedata" inManagedObjectContext:managedObjectContext];
      [savedata setSaveslot1:label1.text];    
      NSError *error;
      if (![managedObjectContext save:&amp;error]) {
          // This is a serious error saying the record could not be saved.
          // Advise the user to restart the application
      }
  }
  </code></pre>
  
  <p>When the button is push, the text in the textfield will save and show it label1.text
  but i got this error. </p>
  
  <pre><code>+entityForName: could not locate an NSManagedObjectModel for entity name 'Savedata''
  </code></pre>
  
  <p>how to fix it?</p>