检查/比较 CloudKit 中的 NSError 代码?

Check / Compare NSError Code in CloudKit?

我想这是基本的,但仍然..我如何检查我是否收到 ZoneBusy 错误?

if error.code == CKErrorCode.ZoneBusy { // <- compiler says can't use '==', then what?

参考:

https://developer.apple.com/library/prerelease/ios/documentation/CloudKit/Reference/CloudKit_constants/index.html#//apple_ref/c/tdef/CKErrorCode

您似乎缺少 .rawValue

所以应该是:

CKErrorCode.ZoneBusy.rawValue