ios - 如何在 ios 中使用 PFInstallation 获取在解析中注册的所有用户

标签 ios objective-c iphone parse-platform

我正在使用下面的代码来获取用户,但我无法获取它..应用程序崩溃...请帮助我获取所有安装对象列表..

PFQuery *userQuery = [PFQuery queryWithClassName:@"_Installation"];
[userQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if (!error) {
        // The find succeeded.
        NSLog(@"Successfully retrieved %d scores.", objects.count);
        NSLog(@"objc...%@",objects);
        // Do something with the found objects
        for (PFObject *object in objects) {
            NSLog(@"id...%@",object.objectId);
        }
    } else {
        // Log details of the failure
        NSLog(@"Error: %@ %@", error, [error userInfo]);
    }
}];

最佳答案

试试这个:

PFQuery *userQuery = [PFInstallation query];
[userQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if (!error) {
        // The find succeeded.
        NSLog(@"Successfully retrieved %d scores.", objects.count);
        NSLog(@"objc...%@",objects);
        // Do something with the found objects
        for (PFObject *object in objects) {
            NSLog(@"id...%@",object.objectId);
        }
    } else {
        // Log details of the failure
        NSLog(@"Error: %@ %@", error, [error userInfo]);
    }
}];

仅供引用,Wain 的评论是正确的,即安装不是用户。您确定这是您要查询的类吗?

关于ios - 如何在 ios 中使用 PFInstallation 获取在解析中注册的所有用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31920676/

相关文章:

ios - Apple Store 分发 - iOs 6-7 应用程序 : updates and maintenance from different mac

ios - 将轨道添加到加星标的播放列表时出现 NSArray 异常

ios - 如何在TableView单元格中显示URL图像而不会卡住?

ios - 我的 iOS 应用程序中的 EXC_BAD_ACCESS KERN_INVALID_ADDRESS

iphone - UITabBarController - 如何为简单的开关设置动画?

ios - MPMusicPlayerController 第一次不工作

ios - Objective-C : get location without delegate

iphone - 如何从选定的 UITableViewCell 获取自定义 NSManagedObject 子类

iphone - 简单的Iphone客户端连接到服务器

objective-c - 尝试垂直对齐 UILabel 文本时出现奇怪的行为