iPhone - 将 NSError 处理到一个范围内

标签 iphone error-handling dns nserror

我正在尝试处理错误,但我发现很难知道可以返回给我什么样的错误。
例如,我从 map View 操作中调用了这个委托(delegate)方法:

- (void) reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error;

我怎么知道通过这种方法可以向我发送什么样的错误?
我不想处理整个错误目录... :-)

最佳答案

MKReverseGeocoder.h 说:

// There are at least two types of errors:
//   - Errors sent up from the underlying connection (temporary condition)
//   - Result not found errors (permanent condition).  The result not found errors
//     will have the domain MKErrorDomain and the code MKErrorPlacemarkNotFound
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error;

猜猜你应该在询问之前阅读文档和标题。

关于iPhone - 将 NSError 处理到一个范围内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6717996/

相关文章:

amazon-web-services - 如何刷新 AWS 中 VPC 中的 DNS 条目?

iphone - NSString:plist 中的换行符转义

python - 类型错误 : input expected at most1 arguments got 3

mysql - php_network_getaddresses : getaddrinfo failed error in Docker's adminer

c++ - : assignment operator not generated and unreferenced formal parameter? 这两个错误是什么原因

visual-studio-2010 - PostBuildEvent 多脚本错误处理

javascript - 如何为 node.js 服务器分配域名?

iphone - 背景图像在某些浏览器上不正确流动

iPhone 在导航 Controller 动画期间崩溃,我有什么选择?

iPhone App调用第三方dylib失败