【发布时间】:2017-02-06 09:46:28
【问题描述】:
在应用程序执行期间,我有时会收到此错误:
PFKeychainStore failed to set object for key 'currentUser', with error: -34018
它并不总是发生,只是有时。 例如,我在 viewDidLoad 中运行这段代码
NSLog(@"%@", [PFUser currentUser]);
if ([ManageConnection isWiFi] || [ManageConnection isFastConnection]) {
[[PFUser currentUser] fetchInBackgroundWithBlock:^(PFObject * _Nullable object, NSError * _Nullable error) {
if (error != nil) {
[ParseErrorHandlingController handleParseError:error];
}
else {
self.user = (PFUser *)object;
当我在控制台 [PFUser currentUser] 值上打印时,它存在
<PFUser: 0x6080000e8980, objectId: 5ZgXxNrT5C, localId: (null)>
但是当我尝试获取用户时,我得到了上面的错误。有什么建议吗?
我正在使用最新版本的 Parse。
【问题讨论】:
-
嗨朱塞佩,我在这里有点困惑。您可以通过 [PFUser currentUser] 获取当前用户,然后为什么需要在后台再次获取它?
-
嗨@SatishMavani,你知道我不是代码的所有者,只是修复了一些错误。之前的开发者写了这个函数。反正我经常遇到这个错误。
-
@SatishMavani 我发现了为什么会有那个“获取”。在 viewDidLoad,我需要一个 [PFUser currentUser] 对象的值。由于该值可能会更改,因此我必须更新我的 [PFUser currentUser] 对象。
标签: ios objective-c xcode parse-platform