답변

2

은 내가 문제를 알아 냈어요 생각합니다. 내 백엔드로 Parse 서비스를 사용하고 있지만 where 절을 추가하려면 -requestForFetchRequest를 재정의하지 않아야합니다. 나는 현재 로그인 한 사용자와 관련된 항목 만 원했습니다. 이것은 고정 된 것으로 보인다.

- (NSURLRequest *)requestForFetchRequest:(NSFetchRequest *)fetchRequest withContext:(NSManagedObjectContext *)context { 
    NSMutableURLRequest *request = [[super requestForFetchRequest:fetchRequest withContext:context] mutableCopy]; 
    NSString *whereUserId = [NSString stringWithFormat:@"where={\"userId\":\"%@\"}",[PFUser currentUser].objectId]; 
    [request setHTTPBody:[whereUserId dataUsingEncoding:NSUTF8StringEncoding]]; 
    return request; 
} 

이제 초기로드 및 각 항목을 선택할 때 가져 오기 요청이 있습니다. 훨씬 더 적절합니다.

+0

어디에서 가져 왔습니까? – Shmidt

+1

내 하위 클래스 AFRESTClient에서 – rnystrom