If one is not going to use the genstrings console tool to create .strings files, is there any benefit to using the NSLocalizedString macros rather than directly calling the NSBundle localizedStringForKey:value:table: method?
Those macros call that same NSBundle method. So is support of genstrings the only purpose to those macros?
If you look at
NSLocalizedStringdefinition:it becomes clear that
NSLocalizedStringjust callslocalizedStringForKey:with default arguments while also allowing for the specification of a comment (which is ignored bylocalizedStringForKey:.)Thus,
localizedStringForKey:is suited for:handling multiple string tables;
specifying a custom-return value when no translation is found (
valuearg).NSLocalizedStringon the contrary:is more suited to the simplest (most common?) case (just one string table);
is more compact;
allows to specify a contextual comment.
When to use one or the other?
IMO, the biggest criteria is if you have multiple string tables. If so, you have to use
localizedStringForKey:, otherwiseNSLocalizedStringwill do just fine.Hope this helps.