title: Is xcdatamodel needed?
body: <p>This is my entity object in my iOS app that uses CoreData.</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;CoreData/CoreData.h&gt;
  
  #import "Price.h"
  
  @interface DataPrice : NSManagedObject
  
  @property (nonatomic) NSInteger id;
  @property (nonatomic, retain) NSNumber *ron95;
  @property (nonatomic, retain) NSNumber *ron92;
  @property (nonatomic, retain) NSNumber *dieselNormal;
  @property (nonatomic, retain) NSNumber *dieselSpecial;
  @property (nonatomic, retain) NSDate *postDate;
  
  + (instancetype)insertDataPriceWithPrice:(Price*)price
                    inManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
  
  + (instancetype)fetchDataPriceInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
  
  + (Price*)fetchPriceInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
  
  @end
  
  
  #import "DataPrice.h"
  
  @implementation DataPrice
  
  @dynamic id;
  @dynamic ron95;
  @dynamic ron92;
  @dynamic dieselNormal;
  @dynamic dieselSpecial;
  @dynamic postDate;
  
  + (instancetype)insertDataPriceWithPrice:(Price*)price
               inManagedObjectContext:(NSManagedObjectContext *)managedObjectContext
  {
      DataPrice* dataPrice = [NSEntityDescription insertNewObjectForEntityForName:self.entityName
                                                 inManagedObjectContext:managedObjectContext];
      dataPrice.id = price.id;
      dataPrice.ron95 = price.ron95;
      dataPrice.ron92 = price.ron92;
      dataPrice.dieselNormal = price.dieselNormal;
      dataPrice.dieselSpecial = price.dieselSpecial;
      dataPrice.postDate = price.postDate;
  
      return dataPrice;
  }
  
  + (NSString*)entityName
  {
      return @"Price";
  }
  
  + (instancetype)fetchDataPriceInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext {
      NSEntityDescription *entity = [NSEntityDescription entityForName:self.entityName inManagedObjectContext:managedObjectContext];
  
      if (!entity) {
          return NULL;
      }
  
  
      NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"postDate" ascending:NO];
  
      NSFetchRequest *request = [[NSFetchRequest alloc] init];
      request.entity = entity;
      request.sortDescriptors = @[ sortDescriptor ];
      request.fetchLimit = 1;
  
      NSError *error;
      NSArray *fetchResults = [managedObjectContext executeFetchRequest:request error:&amp;error];
  
      DataPrice *result = fetchResults.firstObject;
  
      return result;
  }
  
  + (Price*)fetchPriceInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext {
      DataPrice *dataPrice = [self fetchDataPriceInManagedObjectContext:managedObjectContext];
  
      Price *price = [[Price alloc] init];
      price.id = dataPrice.id;
      price.ron92 = dataPrice.ron92;
      price.ron95 = dataPrice.ron95;
      price.dieselNormal = dataPrice.dieselNormal;
      price.dieselSpecial = dataPrice.dieselSpecial;
      price.postDate = dataPrice.postDate;
  
      return price;
  }
  
  
  @end
  </code></pre>
  
  <p>I named the class <code>DataPrice</code> but want the entity to be <code>Price</code>.</p>
  
  <p>Do I need an <code>xcdatamodel</code> for my application and how do I define one?</p>