0
我有一个视图控制器与两层(topLayer和BottomLayer)。在底层,我有一个UITableView。我想要改变topLayer上显示哪些按钮/标签,具体取决于在表格视图中选择的内容。我觉得这样的事情应该工作:基于UITableView选择更改图层背景属性?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
self.topLayer.backgroundColor = [UIColor redColor];
}
}
但是,我运行它每次,在我的tableview,它的故障了(是的,我已经定义并合成两个顶层和BottomLayer)选择第一项。有任何想法吗?
任何错误代码?来自调试器的任何东西? – CodaFi 2012-02-16 05:02:44
我得到一个“线程1:停在断点3:”错误,并且是一个绿色条,突出显示“self.topLayer.backgroudcolor ...”代码行。 – DrTchocky 2012-02-16 05:24:13
它不会崩溃。删除断点。 – Vignesh 2012-02-16 05:45:14