Pedir todas las entidades de cierto tipo


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. NSManagedObjectContext *moc = [self managedObjectContext];
  2. entityForName:@\"GraphicalEntity\" inManagedObjectContext:moc];
  3. NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
  4. [request setEntity:entityDescription];
  5.  
  6. NSError *error = nil;
  7. NSArray *array = [moc executeFetchRequest:request error:&error];
  8. if (array == nil)
  9. {
  10. // TODO: Deal with error...
  11. return nil;
  12. }
  13. else return array;
  14.  
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.