PFFile解析为SWIFT

时间:2014-07-16 17:46:19

标签: objective-c parsing swift ios8 xcode6

正在xCode 6-Beta3中构建应用。当我运行应用程序时,它崩溃了。

但是,如果我//评论//在应用程序下方启动此代码。随着代码被注释掉,因为表已经创建,所以图像将在新用户注册时加载到Parse库。人们也可以从Parse看到并下载它们。所以他们发帖了

但该应用仍然无法预览图像。任何专家帮助表示赞赏。感谢

这是运行时的错误:线程1 EXC_BAD INSTRUCTION(代码= EXC_I138_IVNPO,子代码= 0x0

//个人资料图片代码崩溃app //

            cell.profileImageView.alpha = 0

            let profileImage:PFFile = user["profileImage"] as PFFile

            profileImage.getDataInBackgroundWithBlock{
                (imageData:NSData!, error:NSError!)->Void in

                if !error{
                    let image:UIImage = UIImage(data: imageData)
                    cell.profileImageView.image = image
                }

            }

1 个答案:

答案 0 :(得分:0)

您需要在此函数中调用cell.profileImageView.image = image

override func tableView(tableView: UITableView, cellForRowAtIndexPath         indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as YourCustomCellClass



// Configure the cell...

return cell
}

还要确保将单元格的重用标识符设置为故事板上的“单元格”

相关问题