NSFetchedRequestController with NSSet property as sectionNameKeyPath. Is it possible?
Let's consider I have 2 entities Product and Category with many-to-many relationship between them. I want to fill UITableView with products divided by categori开发者_运维知识库es.
What sectionNameKeyPath should I set to NSFetchedResultsController? Setting @"categories" of type NSSet doesn't make sense.
Assuming you have categoryName for attribute in your Categories Entity, I think your section keypath could be @"categories.categoryName". Where categories is your NSSet pointing to Category Entity objects.
精彩评论