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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to