핵심 데이터 데이터베이스가 있는데 블록 술어를 사용하여 가져 오기 요청을 만들려고하지만 알 수없는 조건부 오류가 발생합니다.NSInvalidArgumentException ', 이유 :'술어에 대한 알 수없는 조건부 유형 : BLOCKPREDICATE (0x70ad750) '오류
NOTE: employeeToHouse is a property of type House that was created for me when I subclassed NSManagedObject
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Place"];
request.predicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
Place *sortPlace = (Place *)evaluatedObject;
CLLocation *placeLocation = [[CLLocation alloc] initWithLatitude:sortPlace.latitude.doubleValue
longitude:sortPlace.longitude.doubleValue];
CLLocationDistance distance = [placeLocation distanceFromLocation:self.userLocation];
sortPlace.distanceToUser = [NSNumber numberWithDouble:distance];
if(distance<3000)
{
return YES;
}
return NO;
}];
request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@ "distanceToUser"
ascending:YES
selector:@selector(localizedCaseInsensitiveCompare:)]];
[self.loadingView removeSpinner];
[self setupFetchedResultsControllerWithFetchRequest:request];
나는이 오류 얻을
:
NSInvalidArgumentException', reason: 'Unknown predicate type for predicate: BLOCKPREDICATE(0x70ad750)'
내가 뭔가 잘못하고 오전?
"알 수없는 조건 자 유형"을 사용하고 있습니까? –
무엇을 의미합니까? –
글쎄, 그게 오류 메시지가 말하는거야. –