views:

248

answers:

1

Hi,

how would you go about saving a state in a tableview-drilldown, when using core data? So next time you start the app, the drill down level you where at when you exit the app will be loaded in.

I looked at apples drilldownsave sample code, but couldn't figure our how to change to code to work with core data.

Any help would be very appreciated. thanks in advance

+2  A: 

Generally you shouldn't do that. Usually (though not always) the model represents some concrete data, where as the position in the drill down is a transient property of a particular user using that data. Most of the time you are better off storing something like that as NSUserDefault, probably as an array of objectIDs for all the NSManagedObjects that should be instantiated and pushed onto the drill down on relaunch.

Sometimes it makes sense to somehow encode that in the model, but in my experience that is not the common case.

Louis Gerbarg