指针数据不存储在本地数据库中,解析ios [英] Pointers data not storing in local database parse ios
问题描述
[query includeKey:@classOne.innerClass];
[query includeKey:@classTwo.innerClass];
[query includeKey:@classThree];
[query includeKey:@classFour];
[查询findObjectsInBackgroundWithBlock:^(NSArray *对象,NSError *错误){
[PFObject pinAllInBackground:objects withName:@LocalRecordsblock:^(BOOL succeeded,NSError * error){
}];
}];
我正在获取记录,如
PFQuery * lquery = [PFQuery queryWithClassName:[ClassName parseClassName]];
[lquery fromPinWithName:@LocalRecords];
BFTask * btask = [[lquery findObjectsInBackground] continueWithSuccessBlock:^ id(BFTask * task){
if(task.error){
NSLog(@Error:%@,task错误);
返回任务;
}
}];
当我尝试访问classOne,classTwo,classThree和classFour中的任何列时,我得到一个异常由于未捕获异常'NSInternalInconsistencyException'终止应用程序,原因:密钥名称没有数据。在获取其值之前调用fetchIfNeeded。
这是Parse.com本地数据存储功能中的一个错误适用于iOS。
从1.6.3发行说明:
改进本地一致性使用includeKey和NSNull值进行数据存储/解析查询。
I have a query with many includeKeys which are pointers to another class. After receiving the data from parse cloud all the records are getting stored locally using pinAll method. When I fetch back the results stored, I can able to get the records but not pointers included. See sample code below
[query includeKey:@"classOne.innerClass"];
[query includeKey:@"classTwo.innerClass"];
[query includeKey:@"classThree"];
[query includeKey:@"classFour"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
[PFObject pinAllInBackground:objects withName:@"LocalRecords" block:^(BOOL succeeded, NSError *error) {
}];
}];
And I am fetching the records like
PFQuery *lquery = [PFQuery queryWithClassName:[ClassName parseClassName]];
[lquery fromPinWithName:@"LocalRecords"];
BFTask *btask = [[lquery findObjectsInBackground] continueWithSuccessBlock:^id(BFTask *task) {
if (task.error) {
NSLog(@"Error: %@", task.error);
return task;
}
}];
When I try to access any of the columns in classOne, classTwo, classThree and classFour I am getting an exception Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Key "name" has no data. Call fetchIfNeeded before getting its value.'
This was a bug in the Parse.com local data store functionality for iOS.
From the 1.6.3 release notes:
"Improved consistency of Local Datastore / Parse queries with includeKey: and NSNull values."
这篇关于指针数据不存储在本地数据库中,解析ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!