문제

코코아의 핵심 데이터 모델에 문제가 있습니다. 아마도 상당히 기본적인 문제 일 것입니다. 내 핵심 데이터 모델의 섹션은 다음과 같습니다. OutputCell Entity의 셀 특성의 값을 감안할 때 관련 히스토그램을 반환하고 싶습니다.

Share photos on twitter with Twitpic

다음 술어를 사용하고 있지만 빈 배열 만 반환합니다. 히스토그램 엔티티를 사용하여 작동 할 수 있었지만 히스토그램에서 히스토그램과 Oputcell로 가로지 못하는 것 같습니다. 내가 사용하는 술어는 다음과 같습니다.

NSEntityDescription *histogramBarEntityDescription = [NSEntityDescription entityForName:@"HistogramBar" 
                                                                inManagedObjectContext:[theDocument managedObjectContext]];
NSFetchRequest *histogramBarRequest = [[[NSFetchRequest alloc] init] autorelease];
[histogramBarRequest setEntity:histogramBarEntityDescription];
NSPredicate *histogramBarPredicate = [NSPredicate predicateWithFormat:@"(histogram.outputCell.cell = %@)", theOutputCell];
[histogramBarRequest setPredicate:histogramBarPredicate];
NSError *histogramBarError = nil;
NSArray *histogramsArray = [[theDocument managedObjectContext] executeFetchRequest:histogramBarRequest 
     error:&histogramBarError];

도움을 주셔서 감사합니다.

도움이 되었습니까?

해결책

내 문제가 해결되었고, 코드의 도적 주석은 히스토그램 엔터티가 생성되는 것을 방지합니다. 이 경우 일부 NSLOG의 자세한 검사는 문제를 발견하는 데 도움이되었습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top