У меня есть UITableView, и я хочу, чтобы некоторые ячейки были стандартными UITableViewCells, и у меня есть одна настраиваемая ячейка, называемая ImageTableViewCell. Я установил эту пользовательскую ячейку в IB и связал ее заголовок и реализацию.
Ячейка нормально загружается в мое представление вместе со стандартными ячейками, но мои данные не помещаются в ячейку во время выполнения. Вот код, который я использую. Вы замечаете что-то не так?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = nil;
if (tableView == self.visitTableView && indexPath.section == 0 && indexPath.row == 0){
CellIdentifier = @"imageCell";
}
else{
CellIdentifier = @"cell";
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
ImageTableViewCell *imageCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (tableView == self.visitTableView)
{
if (indexPath.section == 0)
{
switch (indexPath.row) {
case 0:
imageCell.patientNameLabel = [self.appointmentDictionary objectForKey:@"patient"];
[imageCell.patientImage setImageWithURL:[NSURL URLWithString:[self.appointmentDictionary objectForKey:@"patient_small_photo_url"]] placeholderImage:nil];
break;
case 1:
cell.textLabel.text = @"Appointment";
cell.detailTextLabel.text = [self.appointmentDictionary objectForKey:@"scheduled_time"];
break;
default:
break;
}
}