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提前,乾杯。