Re: Is there such a thing as a global constant (string) in obj-c?
Re: Is there such a thing as a global constant (string) in obj-c?
- Subject: Re: Is there such a thing as a global constant (string) in obj-c?
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 21 Jul 2004 09:00:21 -0600
On Jul 21, 2004, at 8:38 AM, John Spicer wrote:
I've been trying to make one. I tried putting it in the main file as
this
NSString *myconst = @"thedatabit";
and that compiles OK. I then declare it as this in a file I want to use
it in:
extern const NSString *myconst;
Try this instead... In your source file:
NSString * const myconst = @"thedatabit";
And in the header file:
extern NSString * const myconst;
That should work without raising any errors.
Nick Zitzmann
<
http://www.chronosnet.com/>
_______________________________________________
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.