I have an array of Location (NSManagedObject) objects called venues. each location object has a venueID attribute and a name attribute in it (as obtainted from Foursquare API).
Now, I am trying to form a predicate which looks like "location.venueID == <some venue id>" from venueID existing in current Location object in the Venues array.
the code is as follows...
for (Location *venue in venues)
{
NSLog(@"venue object %@",venue);
NSPredicate *venuePredicate = [NSPredicate predicateWithFormat:@"location.venueID = %@",venue.venueID];
NSLog(@"venue predicate %@",venuePredicate);
NSArray *sliceArray = [_fetchedResultsArray filteredArrayUsingPredicate:venuePredicate];
NSLog(@"venue slice array %@",sliceArray);
[slicesDictionary setValue:sliceArray forKey:venue.name];
}The predicate will be applied to a _fetchedResultsArray where the array of an entity A and Location is a relationship object. SO basically I want to filter out all A's which have location object matching the venueID provided.
my problem is I checked using breakpoints and venues array does have a list of Location objects but my predicate looks like this...
2015-08-27 10:25:45.786 AppName[6113:1779399] venue predicate location.venueID == nilAny Help?!