우선 NSDate가 NSTimeInterval 내에 있는지 확인하는 것은 의미가 없습니다. NSTimeInterval은 위치가 아니라 시간 길이를 지정하기 때문입니다. 대신, 간격의 시작과 끝을 지정하는 두 개의 별도 NSDate를 사용하려고합니다.
다음과 같이 표시됩니다 (beginningTime 및 endTime은 NSDates 임).
NSFetchRequest *request = [[NSFetchRequest alloc] init];
request.entity = [NSEntityDescription entityForName:@"YourEntityName" inManagedObjectContext:yourContext];
NSPredicate *beginningPredicate = [NSPredicate predicateWithFormat:@"createdAt >= %@", beginningTime];
NSPredicate *endPredicate = [NSPredicate predicateWithFormat:@"createdAt <= %@", endTime];
request.predicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:beginningPredicate, endPredicate, nil]];
NSArray *results = [yourContext executeFetchRequest:request error:NULL];