0

如何在我的代码中处理此错误“无效会话错误(209)”我使用以下代码:

PFQuery *query = [PFQuery queryWithClassName:@"Query"];
[query whereKey:@"user" equalTo:[PFUser currentUser]];
[query whereKey:@"converted" equalTo:@NO];
query.cachePolicy = kPFCachePolicyNetworkElseCache;
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{ if (!error){ // success }
else { [ParseErrorHandlingController handleParseError:error];}}
4

1 回答 1

0

对于我可以在 Back4App 和 Parse 的文档中检查的内容,我会指出两个问题,您可能已经给出了帖子中显示的代码。

首先,您使用的 SDK 初始化可能会出现一些拼写错误或语法问题,您可以通过查看 B4A 文档建议的内容看到:

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
   configuration.applicationId = @"YOUR_APP_ID";
   configuration.clientKey = @"YOUR_CLIENT_KEY";
   configuration.server = @"https://parseapi.back4app.com";
   configuration.localDatastoreEnabled = YES; // If you need to enable local data store
}]];

然后,我在您的 if-else 子句中发现了一个错字,因为您在添加评论时没有关闭“if”部分,这里:

[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{ if (!error){ // success }
else { [ParseErrorHandlingController handleParseError:error];}}

也许这些是您问题的主要原因。

于 2017-07-19T15:02:23.440 回答