Re: Defining a constant as private
Re: Defining a constant as private
- Subject: Re: Defining a constant as private
- From: Steve Checkoway <email@hidden>
- Date: Wed, 16 Jun 2004 05:16:18 -0700
On Jun 16, 2004, at 5:01 AM, j o a r wrote:
On 2004-06-16, at 13.34, Joakim Danielson wrote:
How do I define a constant to be private to a class, and specially a
string constant?
Something like this in the implementation file of the class:
NSString * const myString = @"SomeStringValue";
That creates a constant NSString object. To create a string constant,
try:
const char *const myString = "SomeStringValue";
Or even better, to ensure it is not externed from somewhere else:
static const char *const myString = "SomeStringValue";
- Steve
_______________________________________________
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.