To declare global variables, you need to declare them outside of any class definition. If I have a lot of global variables, I usually put them in their own source file and call it globals.m to help keep things organized. If I only have one or two, I just declare them in the App delegate (after the #includes but before the @implementation).
int coins;
BOOL btn1Pressed;
BOOL btn2Pressed;
BOOL btn3Pressed;
// etc
Then you declare them in a common header (I use globals.h) as extern
. Declare them outside of any class definition:
extern int coins;
extern BOOL btn1Pressed;
extern BOOL btn2Pressed;
extern BOOL btn3Pressed;
...
That tells the compiler that "this variable is declared elsewhere", so it knows to resolve it at link time. Include that header in any source module that needs access to those variables.