title: CoreData: How to sort NSManagedObject by its primary key?
body: <p>I have one subclass of NSManagedObject like following 
  and stored some instances by NSManagedObjectContext.</p>
  
  <pre>
  @interface SomeModelObject : NSManagedObject  
    @property (nonatomic, retain) NSString * text; 
  @end
  </pre>
  
  <p>Now, I want to fetch the list sorted by its primary key (created automatically).
  I've tried NSFetchRequest and got runtime error: "keypath id not found in entity".</p>
  
  <pre><code>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  NSEntityDescription *entity = [NSEntityDescription entityForName:@"SomeModelObject" inManagedObjectContext:self.managedObjectContext];
  [fetchRequest setEntity:entity];
  
  NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"id" ascending:YES];
  NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sort, nil];
  [fetchRequest setSortDescriptors:sortDescriptors];
  </code></pre>
  
  <p>Is it possible to sort by primary key? Or should I add some column to Model class for sorting?</p>