iOS与Parse.com:双向保存对象

时间:2014-06-18 16:07:46

标签: ios save parse-platform

我有以下设置

@interface PMObject : PFObject <PFSubclassing>

@property (nonatomic, strong) PMUser *creator;

---

@interface PMUser : PFUser <PFSubclassing>

@property (nonatomic, strong) PMObject *currentObject;

this question阅读类似的问题我以下列方式保存新的PMObject:

PMObject *object = [PMObject object];
[object setCreator:[PMUser currentUser]];

[object saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {

 if(succeeded){

    [[PMUser currentUser] setCurrentObject:object];

    //this point is reached as expected
    [[PMUser currentUser] saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {

       //this point is never reached ?

    }];

 }

}];

无论这看起来多么明显,它都没有按预期工作。很乐意为您提供帮助!

0 个答案:

没有答案