• 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: Proper place to define static strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper place to define static strings


  • Subject: Re: Proper place to define static strings
  • From: Adam Thayer <email@hidden>
  • Date: Thu, 29 Aug 2002 23:15:47 -0700

On 2002-08-29 20:31:58 -0400 Philip Streck <email@hidden> wrote:

When writing an Objective C class and you need to define a static string what is the proper place and method of doing so? I assume using #define in my source file is taboo here :-)

Depends on the string... if it needs to be localized (any string that will be read by users) should be stored in a string plist file as part of your project localization. You can then retrieve that string when you create an NSString object.

If you are just doing things like defining keys to use in an NSDictionary, then you could go ahead and either use #define <Something> @"String or @"String" in the code itself to set things up. It is really up to you, but if you are going to release this, keep in mind you need to allow UI strings to get localized.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Proper place to define static strings (From: Philip Streck <email@hidden>)

  • Prev by Date: Proper place to define static strings
  • Next by Date: [ANN] Open source code from Stick Software
  • Previous by thread: Proper place to define static strings
  • Next by thread: Re: Proper place to define static strings
  • Index(es):
    • Date
    • Thread