开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜