У меня есть UITableView, который не создан в раскадровке, а по коду. Эта таблица может быть обновлена путем выбора некоторых других команд, но когда я это сделаю, есть еще одна таблица со старыми данными ... Я установил нуль в самое время, когда я обновляю ...Перезапуск проблемы UITableView
У кого-то есть идея?
Чтобы заполнить таблицу, я использую этот код
listVideo = [listGroupes objectAtIndex:indexPath.row];
montageListView= [[UITableView alloc] initWithFrame:listFrame style:UITableViewStylePlain];
montageListView.delegate = self;
montageListView.dataSource = self;
montageListView.layer.cornerRadius = 10;
[listMontagesView addSubview:montageListView];
так есть новый вид с другой варианты, но если я вернусь с этим кодом:
montagesListView removeFromSuperview];
montagesListView = nil;
и я Пополните его с тот же самый код
listVideo = [listGroupes objectAtIndex:indexPath.row];
montageListView= [[UITableView alloc] initWithFrame:listFrame style:UITableViewStylePlain];
montageListView.delegate = self;
montageListView.dataSource = self;
montageListView.layer.cornerRadius = 10;
[listMontagesView addSubview:montageListView];
и есть хороший стол, но есть другой со старыми данными ... Я действительно не найти проблему с кодом:/
Вот код ячейки для строки, но я не думаю, что это проблема,
static NSString *MyIdentifier = @"MyIdentifier";
NSString *text;
// Try to retrieve from the table view a now-unused cell with the given identifier.
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
// If no cell is available, create a new one using the given identifier.
if (cell == nil) {
// Use the default cell style.
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:MyIdentifier];
}
if (tableView == groupListView) {
text = [listGroupesNames objectAtIndex:indexPath.row];
}else {
text = [[listVideo objectAtIndex:indexPath.row]description];
if ([[listVideo objectAtIndex:indexPath.row]note] == 1) {
cell.imageView.image = [UIImage imageNamed:@"good.png"];
}
if ([[listVideo objectAtIndex:indexPath.row]note] == 2) {
cell.imageView.image = [UIImage imageNamed:@"neutre.png"];
}
if ([[listVideo objectAtIndex:indexPath.row]note] == 3) {
cell.imageView.image = [UIImage imageNamed:@"bad.png"];
}
}
if ([[UIDevice currentDevice]userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
cell.textLabel.font=[UIFont systemFontOfSize:18.0];
text = [NSString stringWithFormat:@" %@",text];
}else{
cell.textLabel.font=[UIFont systemFontOfSize:12.0];
}
if (tableView == groupListView) {
cell.imageView.image = [UIImage imageNamed:@"group.png"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
if(tableView == montageListView){
cell.imageView.image = [UIImage imageNamed:@"videos.png"];
}
cell.textLabel.text = text;
return cell;
Да, я делаю это, поэтому я удаляю его из супервизора, а затем перезапускаю его, чтобы правильно заполнить новую таблицу, но за ней есть старая ... она не получает события касания, но она есть. –
Imma загрузите код –