Re: Global variables?
Re: Global variables?
- Subject: Re: Global variables?
- From: Daniel Jalkut <email@hidden>
- Date: Tue, 27 Dec 2005 09:50:58 -0500
I noticed that the responses thus far have neglected to answer the
"easy" part of your question.
If you want to take the "quick and dirty" route for this, it has
nothing to do with Objective-C or OOP. Just use a global variable in
your main controller's source file, as you would in any conventional
C setting:
int myArray[10];
Then make an extern reference to it in the associated header file:
extern int myArray[10];
Now everybody who imports the header file has access to the array.
Daniel
On Dec 27, 2005, at 5:55 AM, Matt Reagan wrote:
int myIntArray[10];
But despite the public command, I can't seem to access it from another
class. I made sure to include the controller's header file where it's
needed.
What's the easiest way to make some integers available to the whole
application?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden