求指点,AVRelation的使用问题,完全按照官方的文档写的代码,但却报错了,该如何解决呢?

AVObject todoFolder = new AVObject("TodoFolder");// 构建对象
    todoFolder.put("name", "工作");
    todoFolder.put("priority", 1);

    AVObject todo1 = new AVObject("Todo");
    todo1.put("title", "工程师周会");
    todo1.put("content", "每周工程师会议,周一下午2点");
    todo1.put("location", "会议室");

    AVObject todo2 = new AVObject("Todo");
    todo2.put("title", "维护文档");
    todo2.put("content", "每天 16:00 到 18:00 定期维护文档");
    todo2.put("location", "当前工位");

    AVObject todo3 = new AVObject("Todo");
    todo3.put("title", "发布 SDK");
    todo3.put("content", "每周一下午 15:00");
    todo3.put("location", "SA 工位");

    AVRelation<AVObject> relation = todoFolder.getRelation("containedTodos");// 新建一个 AVRelation
    relation.add(todo1);
    relation.add(todo2);
    relation.add(todo3);
    // 上述 3 行代码表示 relation 关联了 3 个 Todo 对象

    todoFolder.saveInBackground();

错误代码如下:

===AVOS Cloud===: LogUtil$avlog->d->28: {"code":106,"error":"Malformed pointer. Pointers must be arrays of a classname and an object id."}

你好,抱歉,我们需要更新下文档,请先使用:

    final AVObject todo1 = new AVObject("Todo");
    todo1.put("title", "工程师周会");
    todo1.put("content", "每周工程师会议,周一下午2点");
    todo1.put("location", "会议室");
    todo1.saveInBackground(new SaveCallback() {
        @Override
        public void done(AVException e) {

            AVObject todoFolder = new AVObject("TodoFolder");// 构建对象
            todoFolder.put("name", "工作");
            todoFolder.put("priority", 1);

            AVRelation<AVObject> relation = todoFolder.getRelation("containedTodos");// 新建一个 AVRelation
            relation.add(todo1);

            todoFolder.saveInBackground();
        }
    });

也就是说 AVObject 在被 AVRelation add 前,必须保存成功有了 objectId 才行。