开发者

NSFetchedRequestController with NSSet property as sectionNameKeyPath. Is it possible?

开发者 https://www.devze.com 2023-03-06 04:38 出处:网络
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.

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

精彩评论

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

关注公众号