i want to access variable in all views ,so how can i declare it ....
views:
34answers:
2
+2
A:
If you really want a global variable, then in a header file that is #included by all your view controllers, put this:
extern int MyVariable;
Then in some .m file (exactly one), put this:
int MyVariable = 0;
But check out that answer about Singletons.
Kristopher Johnson
2010-08-31 16:58:41