KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm writing an API method that returns a list of objects from a web service. This service also caches results and attempts to return the cached results (if any) before hitting the web service again. So I'm storing this list in a Core Data entity. But Core Data only allows to-many relationships to be stored in an NSSet, which does not preserve order. But I want the cached results to retain the original order (which was originally from the web service). I don't necessarily know how that order is established (so I can't sort). So how can I preserve this order? My plan is to store a string with the object ids which I can later use to order them: NSString *objectIds = @"1 5 2 9 4"; Is this the best way to do it?
Tags (comma-separated)
Save Edits
Cancel