I have created a project using Utility Application. It creates 2 views, one main and one flipview. How can i declare a global variable in main so that i can access it in flipview controller too?
A:
If I recall correctly, the flipside view controller is created by the main view controller in the Utility template. If these are the only view controllers you use in your app, you can easily pass data to and from the flipside view controller by adding properties and/or init methods.
However, if you must use a global variable, here's an article that discusses the various methods:
Cocoa with Love: Singletons, AppDelegates and top-level data.
Can Berk Güder
2010-06-07 10:36:34