【发布时间】:2016-09-03 21:59:13
【问题描述】:
我不明白为什么我不能设置我的UIButton 的标题。它在这里崩溃:
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if(section == 0) {
let view = UIView()
view.alpha = 0
return kTableHeaderShouldStickToTop ? view : carouselViewController.view
} else {
let cell = tableView.dequeueReusableCellWithIdentifier("NewsFeedSectionHeaderCell") as! NewsFeedSectionHeaderCell
cell.delegate = self
cell.dataSource = self
cell.followingButton.setTitle("test", forState: .Normal)
return cell
}
}
在我的.xib文件中连接:
【问题讨论】:
-
您是否检查过它是否与 IBOutlet 类连接?
-
是的,这也是我最初的回应。
-
请检查哪个方法首先调用 cellForRow 或 viewForHeaderInSection 因为你正在做的是必须有单元格
标签: ios iphone swift uitableview uibutton