Re: Global variable for whole application.
Re: Global variable for whole application.
- Subject: Re: Global variable for whole application.
- From: Filipe Varela <email@hidden>
- Date: Wed, 18 Apr 2007 09:41:48 +0100
no matter what you're trying to do, that's a very very bad design.
you can't possibly need an application-wide global variable. use
classes, accessors, notifications, delegation, etc
if you really want to go that way, read about two keywords: static
and extern
oh btw, if they're supposed to be constants, why not just #define
them on a common include file. no need to mess with vars. just detect
if they have been previously defined.
#ifndef __COMMON_STUFF__
#define var1 1
#define ...
#endif
On 2007/04/17, at 13:55, Jay wrote:
This is another simple questions, I have no idea in which way to
define some global vaiables(constants) for the whole application,
could someone give me a hint? Many thanks.
regards,
Jay
_______________________________________________
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
_______________________________________________
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