1
这是NSR(只是xcoding初学者),使用的Xcode 4.3.3,无法访问自定义的UILabel在自定义的UITableViewCell
我已经通过故事板制作自定义的UITableView与自定义的UITableViewCell, 我有一个UIBUtton和UILabel在我的自定义单元格中。 i'v删除单元格选择(也清除了背景),以便只有按钮可以访问,用作自定义UILabel的背景。
现在有大量的按钮,因为使用数据数组,当我点击任何按钮,它延伸到另一个视图(细节视图),我想要的是设置自定义标签(设置在详细视图)从“标签”以前选择的按钮... 意味着新的标签=前一页面的点击标签从自定义实现代码如下..
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
Custom *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[Custom alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.myLabel.text = [myArray objectAtIndex:indexPath.row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self.myTable reloadData];
}
我希望你明白我的问题,非常对不起我的英文不好.. 请帮助我,我在一个真正的混乱,因为这个问题已经花了我3天:( Thanx提前,干杯。