Parse iOS SDK, cannot get all fields from _User table

烂漫一生 提交于 2019-12-24 15:02:35

问题


In my application I store information in other fields of the Parse _User table such as a user rank and home City/State. I was able to read all the data from the table for a user simply by running a PFUser query command.

PFQuery *userQuery = [PFUser query];
[userQuery whereKey:PARSE_CLASS_USER_USERNAME equalTo:currentUser.username];

[userQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if (!error)
    {
        PFObject *user = [objects firstObject];
        _userObject = user;
        [[DEPostManager sharedManager] setGoingPost:user[@"eventsGoingTo"]];
        [[DEPostManager sharedManager] setMaybeGoingPost:user[@"eventsMaybeGoingTo"]];
        NSLog(@"Retrieved the user from the server");
    }
}];

Now though, when I run this command, the PFObject that is returned only contains the Username, and the Profile Picture. Does anyone have any idea what in the world can be going on here? Before user[@"eventsGoingTo"] returned a value, now it's nil because that information is not being pulled from the server. Why can I not now get the rest of the data from the table? It just stopped working!


回答1:


Hey I fixed my own problem. It seems that when you update to the newest Parse iOS SDK there's an issue with accessing User information. The way to fix it is simply to do a complete uninstall and clean of the app.



来源:https://stackoverflow.com/questions/28839055/parse-ios-sdk-cannot-get-all-fields-from-user-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!