• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Global variable for whole application.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Global variable for whole application.
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Global variable for whole application. (From: "Jay" <email@hidden>)

  • Prev by Date: PNG in the pasteboard
  • Next by Date: Convert HTML to plain text
  • Previous by thread: Re: Global variable for whole application.
  • Next by thread: Re: Global variable for whole application.
  • Index(es):
    • Date
    • Thread