iphone - Objective-C: Best way to store error messages -
What is the best way to store error messages (Especially for development with Xcode and purpose for Mac and iPhone- C ):
- Error code and related messages
- . List of error codes and related messages
- List of Localizable.string files with error codes that create a separate class
I'm sure there is no reason to give me Because anyone would like to keep all error messages in one place thanks.
Your file is Localizable.strings
. You may have a file named errors.string
. When you want to receive error details, you can use it:
NSString * errCode = @ "err1"; NSString * errDesc = [[NSBundle Main Bundle] Localized StringForki: errCode Value: Zero Table: @ "Errors"];
You can use the plist
file, though all the tasks for you with a string
File is done, you do not have to type any code to parse any file or to start some dictionary or array (no matter how easy, no matter what).
Comments
Post a Comment