Tag Archives: Singleton

Revisiting the Core Data Singleton

      2 Comments on Revisiting the Core Data Singleton

Whilst I’m sure the idea of a Singleton for application wide variables is going to be good one, I must say that I’ve revisited this idea over the last couple of days, especially with the help of an article Core Data: Passing around a NSManagedObjectContext on the iPhone which helps to set the perspective (as it should be) to the… Read more »

Moving Core Data to the Singleton

      1 Comment on Moving Core Data to the Singleton

[UPDATE:] You might like to read Revisiting the Singleton to see how my opinion has changed on this. Now we’ve established the principle of using a Singleton as our main app coordinator, it would make more sense to move the Core Data functions there.  If you choose to add Core Data when generating from an XCode template, these function are… Read more »

Application Wide Variables and Helpers: The Singleton

      1 Comment on Application Wide Variables and Helpers: The Singleton

One dilema when writing an app is where to put variables that contain the data for the application.  Traditional global variables are not a good place, and it becomes nigh on impossible to keep track of where those variables are being access from in the code, and in multi-threaded apps it would also be difficult to coordinate atomic access. Many… Read more »