使用Parse-Server时,解析LocalDataStore不起作用 - '方法需要启用固定。'

时间:2016-02-08 20:56:43

标签: ios parse-platform local-datastore parse-server

我最近开始使用Parse-Server并迁移了我的Parse App,现在当我尝试使用Parse Local DataStore时,我收到以下错误:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Method requires Pinning enabled.'

这是产生错误的代码:

PFQuery *query = [PFQuery queryWithClassName:@"MY_CLASS_NAME"];
[query fromPinWithName:@"PIN_NAME"];
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {

如果我通过调用:

初始化解析旧方法
[Parse setApplicationId:@"APP_ID" clientKey:@"KEY"];

然后本地DataStore工作正常,但如果我初始化解析新方法然后我得到错误:

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {

 configuration.applicationId = @"APP_ID";
 configuration.clientKey = @"KEY";
 configuration.server = @"SERVER";

 }]];

我在Parse初始化之前打电话给[Parse enableLocalDatastore];,我之后也尝试过调用它来确定。

感谢您的时间,希望您能提供帮助

1 个答案:

答案 0 :(得分:14)

我打开了一个issue on GitHub,其中有人为我解决了这个问题:

&#34;如果您正在使用初始化配置 - 您需要稍微区别地启用本地数据存储。将以下行添加到配置块中以启用它:&#34;

Student_Testing.test();
相关问题