我正在使用网站上最新版本的 Parse 在 Swift 中进行开发。我尝试将缓存策略设置为 NetworkElseCache 值,如下所示:
let userRelation = User.currentUser()?.relationForKey("friends")
let userQuery = userRelation!.query()
userQuery.cachePolicy = .NetworkElseCache
userQuery.findObjectsInBackgroundWithBlock {
(users, error) -> Void in
print("Success")
}
错误发生在行上:
userQuery.cachePolicy = .NetworkElseCache
如果删除该行,应用程序运行正常,产生的错误是:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Method not allowed when Pinning is enabled.'
我真的不知道接下来要做什么,我大约一周前才开始使用 Parse 和 Swift 进行 iOS 开发,所以我有点迷茫。我也不理解调用堆栈,也不理解它如何帮助我找到我的问题。
最佳答案
在 AppDelegate.m 中禁用 LocalDataStore
所以评论下面的行
Parse.enableLocalDatastore() // Comment this line and try
关于ios - 设置解析查询的缓存策略会导致应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34864938/