Swift3.0中的Realm意外状态代码:-34018

时间:2016-10-13 07:21:48

标签: realm swift3

运行此代码

SyncUser.authenticate(with: Credential.usernamePassword(username: username, password: password, actions: [.useExistingAccount]), server: Constants.syncAuthURL) { (user, error) in }

返回-34018错误代码

libc++abi.dylib: terminating with uncaught exception of type realm::keychain::KeychainAccessException: Keychain returned unexpected status code: -34018

中的断点
_dispatch_once(dispatch_once_t *predicate,
    DISPATCH_NOESCAPE dispatch_block_t block){
if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) {
    dispatch_once(predicate, block);
} else {
    dispatch_compiler_barrier();
}
DISPATCH_COMPILER_CAN_ASSUME(*predicate == ~0l);}

THX

1 个答案:

答案 0 :(得分:2)

-34018表示errSecMissingEntitlement。尝试指定权利文件,即使它不包含任何权利,也可以解决此问题。

详情请见:https://github.com/realm/realm-cocoa/issues/4158