• 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: Efficiency of loading Localizable.strings and NSUserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficiency of loading Localizable.strings and NSUserDefaults


  • Subject: Re: Efficiency of loading Localizable.strings and NSUserDefaults
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 15 Jul 2009 13:52:17 -0700


On Jul 15, 2009, at 1:45 PM, Development wrote:

Is this true? When I invoke -localizedStringForKey:value:table: (or the other variations of NSLocalizedString), is the entire Localizable.strings file read into memory? Is it thrown away at the end of the call? Or is the localized version of all the strings kept in memory for use? Is the entire file read into memory, or

If it is kept in memory, it makes no sense for me to store the strings in an array. Disk access is slow, but extracting a specific string from a block of data already in memory is fairly fast. In fact, when I load in 10 strings from the Localizable.strings file, am I reading the entire file in 10 times? I can not image this is the case, there must be some buffering happening.

The current behavior is that strings read in from a .strings file are cached. I won't guarantee that they will always all be cached indefinitely, but in general you can expect that subsequent requests for the same string after the first will be fast.


Douglas Davidson

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >Efficiency of loading Localizable.strings and NSUserDefaults (From: Development <email@hidden>)

  • Prev by Date: Plain Text Kind
  • Next by Date: Reference Count Underflow when Writing PDF
  • Previous by thread: Efficiency of loading Localizable.strings and NSUserDefaults
  • Next by thread: Re: Efficiency of loading Localizable.strings and NSUserDefaults
  • Index(es):
    • Date
    • Thread