Re: Defining a constant as private
Re: Defining a constant as private
- Subject: Re: Defining a constant as private
- From: Wade Tregaskis <email@hidden>
- Date: Wed, 16 Jun 2004 21:44:58 +1000
How do I define a constant to be private to a class, and specially a
string constant?
ObjC isn't big on things being private... the only reliable way to do
this is to #define your value, but that's not a good idea for
non-immediate (i.e. non-integer, basically) values.
The best way, I guess, is to just define the constant in your
implementation file, so it's not visible to the outside world. Leave
it undocumented, or if you must document it make it quite explicit that
it shouldn't be used (provide a good reason, too). 3rd party
developers could always declare it as extern manually, but that's
probably a danger you'll have to accept... they could always modify
your source to expose it anyway, if all else fails. :)
Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.