草庐IT

QuestionTableViewCell

全部标签

ios - 如何在 Swift 中正确转换为子类?

我有一个包含许多不同单元格的UITableView,根据数据源的内容数组中的内容,它们应该显示自定义内容。functableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{varcell:UITableViewCell?=nilletobjectAtIndexPath:AnyObject=contentArray![indexPath.row]ifletquestionText=objectAtIndexPathas?String{cell=tableView