ios - 刷新 PFInstallation.currentInstallation() 时出错

标签 ios parse-platform ios-simulator

调用 PFInstallation.currentInstallation().fetchInBackgroundWithBlock 时出现以下错误。

2015-07-31 07:12:13.944 Heist Buddy[20052:148805] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't refresh an object that hasn't been saved to the server.'

我在 iOS 模拟器中重置内容和设置后开始收到此错误。

似乎 PFInstallation.currentInstallation() 没有保存到 Parse.com,当我打印 currentInstallation 时,我得到:

{ deviceType = ios; installationId = "475ee2cb-2513-4e45-a4ae-a3b82c12ee8a"; }

与 Parse.com 上的其他安装条目相比,它似乎缺少一些字段。

我尝试使用 PFInstallation.currentInstallation.saveInBackground 进行保存,但最终出现了同样的错误。我试着四处寻找解决方案,我设法找到了 a post on Parse.com关于同样的问题,但似乎没有解决。

我对 PFInstallation 停止保存的原因感到困惑。互联网连接不是问题。

最佳答案

使用 saveInBackgroundWithBlock 解决了我的问题

关于ios - 刷新 PFInstallation.currentInstallation() 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31734429/

相关文章:

ios - 如何防止源 View Controller 在推送后消失?

ios - 断言失败 : (result == KERN_SUCCESS), 函数 +[XPCMachSendRight wrapSendRight:]

ios - 解析 Objective C 库在 [PFInternalUtils installationId] 上崩溃

swift - GPUImage3模拟器错误(`Error: MPS does not support the iOS simulator.')

ios - 我可以让 iOS Simulator 监听键盘事件以进行调试吗?

iphone - UITabBar 图像在模拟器上可见,在设备上消失

iOS swift - 如何仅在着陆时显示 'jump',没有空中跳跃 - (touchesBegan)

objective-c - Objective-C 中的只读分层模型

ios - 使用缓存实现 PFQueryTableViewController

iOS 如何从解析 Swift 4 中获取值 "Boolean"