What’s the best way to store error messages (specially while developing with Xcode and Objective-C for Mac and iPhone):
- Creating a separate class that
contains list of error code and
corresponding messages - .plist of
error code and corresponding
messages - Localizable.string file
with error code and corresponding
messages (the application may or may
not support localization) - Other(s)
I’m sure i don’t have to give a reason why anyone would want to keep all the error messages in one location. Thanks.
Your file doesn’t have to be called
Localizable.strings. You can have a file calledErrors.strings. When you want to get the error description, you can use:You could use a
plistfile, however all the work is done for you with astringsfile, you don’t have to write any code to parse any file or initialise some dictionary or array (no matter how easy that is anyway).