ios - 为什么我只得到 PFFile 的 2 个对象,而 String 却得到 10 个对象?

标签 ios swift parse-platform

我正在导入个人资料图片以及姓名等其他信息。有 10 个对象,从 Parse 导入时得到 10 个名称,但只得到两张照片。我可以 100% 确保列名称正确并且列中有图像。我不知道这个错误是否有任何相关性,但我猜它确实 Error

let imagequery = PFQuery(className: "Animal")
    imagequery.findObjectsInBackgroundWithBlock { (objects: [PFObject]?, error: NSError?) -> Void in
        if(error == nil){
        for object in objects!{

            if let thumbNail = object["Pic"] as? PFFile{
            thumbNail.getDataInBackgroundWithBlock({
                (imageData: NSData?, error: NSError?) -> Void in
                if (error == nil) {
                    let image = UIImage(data:imageData!)
                    //image object implementation
                    self.tableImage.append(image!)
                    print(image)
                    }

                })
            }
            if let name = object["Name"] as? String{
                self.Name.append(name)
                dispatch_async(dispatch_get_main_queue(), { () -> Void in
                    self.collectionview.reloadData()
                })
            }

最佳答案

当我从另一个解析应用程序导入行时,类似的事情发生在我身上,图像无法工作,因为解析文件不在该数据库中。我清理了该列并再次上传了图像,它成功了。

关于ios - 为什么我只得到 PFFile 的 2 个对象,而 String 却得到 10 个对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36675591/

相关文章:

ios - Objective-C UITableView单元格图像

ios - 如何提取 DynamoDB 表中的第一行?

ios - 无法为 'RealmSwift' 加载底层模块

c# - 在 parse.com 中一次保存多个对象

javascript - 多次调用云代码函数

ios - 来自 typography.com 的 H&FJ 字体在 iOS 上看起来很糟糕

objective-c - 如何在 ScrollView 中滚动

ios - 为什么应用程序打开时主视图 Controller 不卸载

ios - Realm - 对象中的对象列表(Swift 3)

objective-c - PFUser 在 fetchAllIfNeeded 之后调用 objectForKey 时抛出 NSInternalInconsistencyException