重新打开应用后,我无法检索本地数据(固定对象)。
我的控制器中有这个代码:
- (IBAction)btnAddTouched:(id)sender
{
PFObject *object = [PFObject objectWithClassName:@"Foobar"];
[object setValue:[[NSDate date] description] forKey:@"data"];
[object pinInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (succeeded) {
NSLog(@"Pinned OK");
}else{
NSLog(@"Erro: %@", error.localizedDescription);
}
}];
}
- (IBAction)btnLoadTouched:(id)sender
{
PFQuery *query = [PFQuery queryWithClassName:@"Foobar"];
[query fromLocalDatastore];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
NSLog(@"%@", objects);
}else{
NSLog(@"Erro: %@", error.localizedDescription);
}
}];
}
重现的步骤:
btnAddTouched:
固定一些对象; btnLoadTouched
; 它正在检索localId: (null)
的对象:
"<Foobar: 0x15d42770, objectId: new, localId: (null)> {\n data = \"2014-12-15 21:00:05 +0000\";\n}"
)
之后pinInBackgroundWithBlock:
不再工作了。那时块永远不会被调用。
答案 0 :(得分:0)
Parse iOS SDK版本1.6.1解决了这个错误。