2011-07-16 21 views
2

我想处理错误,我很难知道哪种错误可以返回给我。 例如,我有这个从地图视图操作称为委托方法:iPhone - 处理NSError到一个范围

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

我怎么可能会知道什么样的错误,可以通过这种方法来送给我的? 我不希望有处理整个错误目录... :-)

回答

0

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; 

猜在提问前应该阅读文档和头文件。

+0

谢谢,但我没有找到你指向的文档:http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKReverseGeocoderDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/MKReverseGeocoderDelegate我不应该读头才能找到我应该处理的内容。那里没有文档吗?如果方法标题不能提供这些提示,我该怎么办?而这些线路并没有确切地说明会发生什么错误。必须明白MKErrorCode与MKErrorDomain链接。不平凡。 – Oliver