无法从“解析本地数据存储”检索本地数据(固定对象) [英] Can't retrieve local data (pinned objects) from Parse Local Datastore

查看:120
本文介绍了无法从“解析本地数据存储”检索本地数据(固定对象)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重新开启应用程式后,我无法撷取本机资料(固定物件)。

I can't retrieve the local data (pinned objects) after re-open the app.

我的控制器中有这个程式码:

I have this code in my controller:

- (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);
        }
    }];
}

重现步骤:


  1. 使用 btnAddTouched:绑定某些对象

  2. 关闭应用程式(停止debbuging);

  3. 再次打开应用程序(再次构建);

  4. 尝试使用 btnLoadTouched加载固定数据 ;

  1. Pin some objects with btnAddTouched:;
  2. Close the app (stop debbuging);
  3. Open the app again (build again);
  4. Try Load pinned data with btnLoadTouched;

它正在检索 localId:(null)

"<Foobar: 0x15d42770, objectId: new, localId: (null)> {\n    data = \"2014-12-15 21:00:05 +0000\";\n}"
    )


b $ b

之后, pinInBackgroundWithBlock:将不再工作。

推荐答案

Parse iOS SDK 1.6.1版修正了这个错误。

The Parse iOS SDK release 1.6.1 fixed this bug.

这篇关于无法从“解析本地数据存储”检索本地数据(固定对象)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆