tags:

views:

72

answers:

1

Must I do something like this?

NSString *errorDescription = [error localizedDescription];
NSString *errorInfoStr = NSLocalizedString(errorDescription, nil);

Or do I use NSLocalizedString already when populating the userInfo dictionary with the NSLocalizedDescriptionKey key and value? So the value for that is not actually a key for NSLocalizedString, but it is the actual localized string ready to show up on screen?

+1  A: 

Well the docs say

Returns a string containing the localized description of the error.

So the method should return a string that is ready to be displayed to the user. The NSError objects returned by the iPhone SDK functions contain human-readable strings so you should do the same.

If you are wanting to localize your own error messages then you should use NSLocalizedString when constructing the NSError (i.e. when setting the value of the NSLocalizedDescriptionKey key in userInfo).

Mike Weller