我正在用xCode 6-Beta3构建一个应用程序。当我运行应用程序时,它崩溃了。
但是,如果我//注释//输出下面的代码,应用程序就会启动。使用注释掉的代码,图像将在新用户注册时加载到Parse库中,因为该表已创建。人们也可以从Parse中查看和下载它们。所以他们张贴了
但该应用程序仍然不会预览图像。任何专家的帮助都是非常感谢的。谢谢
这是运行时的错误:线程1 EXC_BAD指令(code=EXC_I138_IVNPO,subcode=0x0
//应用程序崩溃的配置文件图像代码//
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
}
}发布于 2015-02-23 06:58:08
您需要在此函数中调用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
}还要确保在情节提要中将单元格的重用标识符设置为“cell
https://stackoverflow.com/questions/24787382
复制相似问题