사용자 지정 UITableView 셀을 설정했으며 didSelectRowAtIndexPath:
메서드의 속성에 액세스하려고합니다. 그러나, 사용중인 다음 코드에서는 해당 속성 (레이블, 텍스트 필드 등)에 액세스 할 수 없습니다. 나는 또한 cellForRowAtIndexPath:
을 참고로 게시했다. 여기에, 나는 didSelectRowAtIndexPath:
에서 사용하고있는 코드입니다커스텀 UITableViewCell을 정의하는 방법?
UITableViewCell *cell = [self.setupTable cellForRowAtIndexPath:indexPath];
는 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' 클래스의 헤더 파일을 게시 할 수 있습니다. –