Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 为什么在Cocoa应用程序中SFHFKeychainUtils失败并出现错误errSecAuthFailed?_Objective C_Cocoa_Sfhfkeychainutils - Fatal编程技术网

Objective c 为什么在Cocoa应用程序中SFHFKeychainUtils失败并出现错误errSecAuthFailed?

Objective c 为什么在Cocoa应用程序中SFHFKeychainUtils失败并出现错误errSecAuthFailed?,objective-c,cocoa,sfhfkeychainutils,Objective C,Cocoa,Sfhfkeychainutils,使用SFHFKeychainUtils的一些代码的调试构建在我正在开发的mac上毫无怨言地工作,在另一个mac上触发了一个错误: 该代码使用了SFHFKeychainUtils提供的以下方法: +[SFHFKeychainUtils getPasswordForUsername:andServiceName:accessGroup:error:] +[SFHFKeychainUtils storeUsername:andPassword:forServiceName:accessGroup:u

使用SFHFKeychainUtils的一些代码的调试构建在我正在开发的mac上毫无怨言地工作,在另一个mac上触发了一个错误:

该代码使用了SFHFKeychainUtils提供的以下方法:

+[SFHFKeychainUtils getPasswordForUsername:andServiceName:accessGroup:error:]

+[SFHFKeychainUtils storeUsername:andPassword:forServiceName:accessGroup:updateExisting:updateExisting:error:]
使用
+[SFHFKeychainUtils storeUsername:andPassword:forServiceName:accessGroup:updateExisting:updateExisting:error://code>为用户名添加密码。一段时间后,尝试使用
+[SFHFKeychainUtils getPasswordForUsername:andServiceName:accessGroup:error://code>检索密码。但是,此方法返回错误;其域是
SFHFKeychainUtilsErrorDomain
,其代码是
-25293
(因此它是
errsecauthfiled
)。只有当密码实际上存储在钥匙链中时(或者至少当密码在钥匙链访问中可见时),才会返回此错误


为什么会发生这种情况?

问题在于缺少代码签名。第二台机器需要代码签名才能访问钥匙链。修复方法是为调试版本启用代码签名。

问题是缺少代码签名。第二台机器需要代码签名才能访问钥匙链。修复方法是为调试版本启用代码签名