Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 解析Heroku迁移(MongoLab):关系问题_Ios_Heroku_Parse Platform_Mlab_Pfrelation - Fatal编程技术网

Ios 解析Heroku迁移(MongoLab):关系问题

Ios 解析Heroku迁移(MongoLab):关系问题,ios,heroku,parse-platform,mlab,pfrelation,Ios,Heroku,Parse Platform,Mlab,Pfrelation,我成功地使用mongolab将解析迁移到解析服务器。现在一切都按预期进行了,除了我使用MongoLab使用PFUser登录时,我的PFRelation对象总是空的 在我的AppDelegate中,当我运行此代码(正式解析)时: HomeView.m: self.currentUser = [PFUser currentUser]; self.friendsRelation = [[PFUser currentUser] objectForKey:@"friends"]; NSLog(@"%@",

我成功地使用mongolab将解析迁移到解析服务器。现在一切都按预期进行了,除了我使用MongoLab使用PFUser登录时,我的PFRelation对象总是空的

在我的AppDelegate中,当我运行此代码(正式解析)时:

HomeView.m:

self.currentUser = [PFUser currentUser];
self.friendsRelation = [[PFUser currentUser] objectForKey:@"friends"];
NSLog(@"%@", self.currentUser);
NSLog(@"%@", self.friendsRelation);
登录后,我的HomeView会记录以下内容:

2016-02-28 23:25:38.756 ChillN[4131:57119] <PFUser: 0x7fe0b3e4fc10, objectId: MZdPHaqByR, localId: (null)> {
    friends = "<PFRelation: 0x7fe0b3e4f900, 0x7fe0b3e4fc10.friends -> _User>";
    phone = "06 19 05 39 30";
    surname = a;
    username = a;
}
2016-02-28 23:25:38.756 ChillN[4131:57119] <PFRelation: 0x7fe0b3e4f900, 0x7fe0b3e4fc10.friends -> _User>
这是我的数据库: 解析:

Heroku(蒙古语):

以下是蒙古银行用户的记录:

{
    "_id": "MZdPHaqByR",
    "_perishable_token": "SHuhtWl0EoxxmNLOkspmp1vBF",
    "username": "a",
    "phone": "06 19 05 39 27",
    "surname": "a",
    "_session_token": "zO2drjzrO0To1q0JiohaL8f4v",
    "_hashed_password": "$2a$10$a7j5yB7uFDtv.YnHESVJgO9Io.nci8hbx7vngOo.FyzA3qBLxw38G",
    "_created_at": {
        "$date": "2016-02-28T21:55:48.548Z"
    },
    "_updated_at": {
        "$date": "2016-02-28T22:03:45.704Z"
    }
}

这只是我代码中的一个错误,我必须替换:

self.friendsRelation = [[PFUser currentUser] objectForKey:@"friends"];

希望这能帮助另一个人。干杯

2016-02-28 23:29:21.785 ChillN[4281:59046] <PFUser: 0x7fa43c09ed20, objectId: MZdPHaqByR, localId: (null)> {
    phone = "06 19 05 39 27";
    surname = a;
    username = a;
}
2016-02-28 23:29:21.786 ChillN[4281:59046] (null)
[PFUser logInWithUsernameInBackground:user
                                 password:password block:^(PFUser *user, NSError *error) {}];
{
    "_id": "MZdPHaqByR",
    "_perishable_token": "SHuhtWl0EoxxmNLOkspmp1vBF",
    "username": "a",
    "phone": "06 19 05 39 27",
    "surname": "a",
    "_session_token": "zO2drjzrO0To1q0JiohaL8f4v",
    "_hashed_password": "$2a$10$a7j5yB7uFDtv.YnHESVJgO9Io.nci8hbx7vngOo.FyzA3qBLxw38G",
    "_created_at": {
        "$date": "2016-02-28T21:55:48.548Z"
    },
    "_updated_at": {
        "$date": "2016-02-28T22:03:45.704Z"
    }
}
self.friendsRelation = [[PFUser currentUser] objectForKey:@"friends"];
self.friendsRelation = [[PFUser currentUser] relationForKey:@"friends"];