【发布时间】:2015-06-05 13:48:43
【问题描述】:
这就是我创建单元格的方式:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("FbFriendCell") as! FbFriendCell
cell.initialize()
return cell
}
很简单。
在 initialize() 函数中,我下载了一张图片并将其放入 UIImageView 中:
let theImageView = UIImageView(image: userPhoto)
theImageView.frame = CGRect(x: 0, y: 0, width: 80, height: 80)
self.addSubview(theImageView)
theImageView.image = userPhoto
println("The image has been set !")
问题是图像仅在此日志消息后几秒钟出现:
println("The image has been set !")
如何强制重新加载图像?
* 阅读本文 * => 该问题可能与图像位于 UITableViewCell 内的事实密切相关!
【问题讨论】:
-
发布您用于下载图像的代码。听起来这需要在完成块中处理。
-
在完成块中处理。
标签: ios objective-c uitableview swift uiimageview