我是使用 Objective-C 为 iOS 应用程序编程的新手。如何创建自己的错误域和错误代码以在我自己的应用程序中使用?
最佳答案
根据Error Handling Programming Guide :
You can create your own error domains and error codes for use in your own frameworks, or even in your own applications. It is recommended that the string constant for the domain be of the form com.company.framework_or_app.ErrorDomain.
所以只要使用像@"com.company.myapp.ErrorDomain"这样的NSString。
关于iphone - 如何为 iOS 应用程序创建自定义错误域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7034762/