Re: Sharing a global variable in Cocoa
Re: Sharing a global variable in Cocoa
- Subject: Re: Sharing a global variable in Cocoa
- From: Thomas Lachand-Robert <email@hidden>
- Date: Mon, 15 Apr 2002 16:38:29 +0200
Le lundi 15 avril 2002, ` 03:34 , Jesus De Meyer a icrit :
Perhaps this is a dumb question but how on earth do you share a varibale
between several objects in Cocoa. Each time I try to do this in a global.
h file I get this error: ...failed MasterObjectFile.Combine and then the
path to master.o
Exactly the same way than in C:
in your header file, declare:
extern int myGlobalVar;
In ONLY ONE .m or .c file declare the var and initial value:
int myGlobalVar = 1; // initial value
Ensure that the latter actually imports the header file.
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.