• 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: "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

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

  • Prev by Date: NSTableView and first responder
  • Next by Date: Migration Path for NSArchiver data?
  • Previous by thread: Re: Global variable for whole application.
  • Next by thread: Re: Global variable for whole application.
  • Index(es):
    • Date
    • Thread