Re: Global variable for whole application.
Re: Global variable for whole application.
- Subject: Re: Global variable for whole application.
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 18 Apr 2007 08:29:23 -0700
On 4/18/07, Filipe Varela <email@hidden> wrote:
Well in that specific case, you're declaring constants for message
strings and assigning them values in the implementation file. Why not
use localizations instead?
The string in my example are not in anyway intended for display to an
end user. In this particular case they are used for names of
NSNotifications and in some situations the pointer value is considered
instead of the actual string content. To allow for that a single
constant pointer has to exist across the whole application. Many
similar usage model exists to this. For example exporting constants
from frameworks can allow useful capabilities especially if you
consider weak linking capabilities.
Threading is a big topic but it doesn't mean you automatically throw
out the use of globals and globals constants.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden