views:

34

answers:

2

i want to access variable in all views ,so how can i declare it ....

+1  A: 

Have a look at Singletons See here and here

epatel
+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