在应用程序执行有时我得到这个错误:iOS的分析和对象 - C:PFKeychainStore无法设置对象键“currentUser”
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,你知道我不是代码的所有者,只是修复一些错误。之前的开发者写了这个func。无论如何,我经常会遇到这个错误。 –
@SatishMavani我发现为什么有那个“抓取”。在viewDidLoad中,我需要[PFUser currentUser]对象的值。由于该值可能会发生变化,因此我必须更新我的[PFUser currentUser]对象。 –