怎么给cell里有tag的控件赋值?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
let cell = tableView.dequeueReusableCellWithIdentifier("tonggaocell", forIndexPath: indexPath) as! UITableViewCell //1
let tonggao = tonggaos[indexPath.row] as TongGaoModel //2
let nameLabel = cell.viewWithTag(101) as? UILabel
nameLabel!.text = tonggao.title
return cell
}
nameLabel!.text = tonggao.title
返回值一直是nil,程序崩溃