Posted By

buscarini on 11/30/-1


Tagged

fetch textmate cocoa coredata mac


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

daniel
xaviaracil
zingo


Pedir todas las entidades de cierto tipo


 / Published in: Objective C
 

  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  

You need to login to post a comment.