I have been researching this problem for a long time, and I can't seem to find the answer to this question. I am fairly new to iPhone programming, so sorry if this is a stupid question. If anyone has just specific code to post showing how this can be done, that will be very helpful.
Objective-C is a superset of C, so just do it the C way:
int globalX = 100;
And header file:
extern int globalX;
You do it exactly the way you would in C. Here's a simple example:
int myGlobal = 3;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With