Я установил пользовательскую ячейку UITableView и хотел бы получить доступ к ее свойствам в методе didSelectRowAtIndexPath:
. Однако следующий код, который я использую, не позволяет мне получить доступ к его свойствам (метки, текстовые поля и т. Д.). Я также разместил свой cellForRowAtIndexPath:
для справки.Как определить пользовательский UITableViewCell?
UITableViewCell *cell = [self.setupTable cellForRowAtIndexPath:indexPath];
Вот код, я использую в didSelectRowAtIndexPath:
, вот cellForRowAtIndexPath:
.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"SetupCellID";
SetupCell *cell = (SetupCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SetupCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.accessoryType = UITableViewCellAccessoryCheckmark;
cell.setupFeedName.text = [self.setupFeeds objectAtIndex:indexPath.row];
return cell;
}
Любая помощь приветствуется!
Вы можете разместить файл заголовка вашего 'SetupCell' класса. –