我有一个查询与许多includeKeys是指向另一个类的指针.从解析云接收到数据后,所有的记录将使用pinAll方法在本地存储.当我回收存储结果时,我可以获取记录,但不能包含指针.请参见下面的示例代码
@H_301_11@解决方法
[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) { }]; }];
我正在拿取记录
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; } }];
当我尝试访问classOne,classTwo,classThree和classFour中的任何列时,我得到一个异常终止应用程序由于未捕获的异常’NSInternalInconsistencyException’,原因:’Key“名称”没有数据.在获取其值之前调用fetchIfNeeded.