Re: Global variable for whole application.
Re: Global variable for whole application.
- Subject: Re: Global variable for whole application.
- From: "Tony S. Wu" <email@hidden>
- Date: Wed, 18 Apr 2007 21:41:00 -0700
my approach is to create a class that handles global variables.
Tony S. Wu
email@hidden
On Apr 18, 2007, at 8:29 AM, Shawn Erickson wrote:
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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