I have a navigation-based view setup, where I have a MKMapView in the first view that loads, with a bunch of annotations.
When the annotation's detail disclosure is tapped, I push into a second view display (a detail view), and the annotation passes a title and a parishNumber to the detail view.
What I'd like to do is use that parishNumber to lookup the values for one 'Parish' record in my core data store, using a fetchRequest.
However, my familiarity with Core Data is less than poor, and I was wondering if anyone had any good pointers for doing a query like this against Core Data (something like grabbing one row in SQL with a WHERE clause like "WHERE parishNumber = 123").
I can get the entire array using a fetch request that gets all the objects like the following:
Code:
NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&error];
for (Parish *info in fetchedObjects) {
// do stuff here
}
...but I don't know how to just grab one 'row' from Core Data. Surely there's a more performant option than getting the entire array again?