解析iOS SDK,无法从_User表中获取所有字段 [英] Parse iOS SDK, cannot get all fields from _User table

查看:157
本文介绍了解析iOS SDK,无法从_User表中获取所有字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我将信息存储在Parse _User表的其他字段中,例如用户排名和主页城市/州。只需运行PFUser查询命令,我就能够从用户的表中读取所有数据。

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

现在,当我运行此命令时,返回的PFObject只包含用户名,并且个人资料图片有谁知道这个世界上会发生什么?在用户[@eventsGoingTo]返回一个值之前,现在它为零,因为该信息未从服务器中提取。为什么我现在不能从表中获取其余数据?它刚刚停止工作!

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!

推荐答案

嘿我修复了自己的问题。当您更新到最新的Parse iOS SDK时,似乎存在访问用户信息的问题。修复它的方法就是完全卸载并清理应用程序。

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.

这篇关于解析iOS SDK,无法从_User表中获取所有字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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