Im planning on using CoreData to model a “News” iOS app. This’ll have many sections (read a UITabBarItem) which will contain many articles (in a UITableView). The articles might appear in other sections too. Also the sort order of each article is another important factor.
In database lingo I'd have
I have tried and can’t model this in CoreData. Im stuck with a
However with this I don’t know how to derive the sort order. Any hint on how to do this is very much appreciated. Thanks in advance.
Sandeep
I had to stop thinking in terms of database to sort this out. My solution involved 2 Classes:
Properties: * List name * Article Id * Sort order
Relationship: * Article ; one-to-one
Properties: * Article Id * ....
Relationship: * List ; one-to-many
I query the ArticleList and sort on sortOrder to get a list of articles for a particular feed/section. Then use the valueForKeyPath: to fetch article properties (such as title etc).