About Saving Loading lines?


#1

I’ve implemented my line saving/loading by using a copy of PossessionStore singleton and the File Helpers class. Making use of Xcode’s refactor option on the context menu made light work of renaming all the variables and methods. I also did the same thing for the save map points challenge so I could use it for the version of whereAmI that I used as the 3rd tab in HypnoTime. I found this to be any easy way to get around the issue I’ve seen others mention of how to get to the info from views and controllers etc from within the appDelegate. Just import PossessionStore.h/MPStore.h/LineStore.h etc… into the appDelegate and call [[WhateverYourSIngletonClass defaultStore] saveChanges]from the applicationDidEnterBackGround Method and viola. It is also just as simple to import the singleton class where ever you need these values in your app.

I’m curious though as I’ve not seen many others reuse the singleton like this. Am I overusing this type of store? I tend to think if something works go with it, rather than reinvent the wheel. Are there drawbacks to the singleton that should have me rethink my reliance on the singleton? Any thoughts?