Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b)
- 2)
- NSManagedObjectContext *moc = [self managedObjectContext];
- NSEntityDescription *entityDescription = [NSEntityDescription
- entityForName:@"SearchEngine" inManagedObjectContext:moc];
- NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
- [request setEntity:entityDescription];
- NSPredicate *predicate = [NSPredicate predicateWithFormat:
- @"engineName LIKE[c] '%@'", selectedEngineName];
- [request setPredicate:predicate];
- NSError *error = nil;
- NSArray *array = [moc executeFetchRequest:request error:&error];
- if (array == nil)
- {
- // Deal with error...
- }
- NSURL *moIDURL = [[myManagedObject objectID] URIRepresentation];
- NSManagedObjectID *moID = [myPersistentStoreCoordinator managedObjectIDForURIRepresentation:moIDURL];
- NSManagedObject *myManagedObject = [myContext objectWithID:moID];
Add Comment
Please, Sign In to add comment