0
나는 임시 개체 titleFirstLetter
임시 속성 및 FetchRequest?
및이 특성을 섹션 이름으로 사용하려고하지만 실행할 때 :
// Create the sort descriptors array.
NSSortDescriptor *authorDescriptor = [[NSSortDescriptor alloc] initWithKey:@"titleFirstLetter" ascending:YES];
NSSortDescriptor *titleDescriptor = [[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:authorDescriptor, titleDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
// Create and initialize the fetch results controller.
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:@"titleFirstLetter" cacheName:nil];
self.fetchedResultsController = aFetchedResultsController;
fetchedResultsController.delegate = self;
이 오류가 발생합니다 :
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'keypath titleFirstLetter not found in entity <NSSQLEntity Book id=1>'
도와주세요!
http://stackoverflow.com/a/3553471에서보세요. – malaba