[英]UITableViewCell's not appearing at all
我的UITableViewCell
没有出现。
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return resultsProdName.count
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 140
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: tvcMyProducts = tableView.dequeueReusableCellWithIdentifier("tblViewCellMyProdsss", forIndexPath: indexPath) as! tvcMyProducts
if self.resultsProdsDescArray.count > 0 && self.resultsProdName.count > 0 {
cell.lblProdDesc.text = self.resultsProdsDescArray[indexPath.row]
cell.lblProdName.text = self.resultsProdName[indexPath.row]
if (self.resultsHasProdPicArray[indexPath.row] != false) {
resultsProdPicArray[indexPath.row]?.getDataInBackgroundWithBlock({ (imgData: NSData?, error: NSError?) -> Void in
if error == nil {
cell.imgViewProdPic.image = UIImage(data: imgData!)
}
})
}
}
return cell
}
我已经使超类符合: UITableViewDataSource, UITableViewDelegate
我已经完成了搜索的所有工作,但仍然没有出现。 UITableViewCell
甚至具有我在代码中调用的唯一标识符: tblViewCellMyProdsss
tvcMyProducts
类是一个UITableViewCell
,其中包含imgViewProdPic
和lblProdName
等。
我想念什么或做错什么?
当我使用输入的“库存数据”运行程序时,甚至没有出现UITableViewCell
。 它根本没有出现。
然后我自己修复它。 我只需要添加以下内容:调用函数后, self.tblViewMyProds.reloadData()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.