스토리 보드에는 작성되지 않았지만 코드별로 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;
그래, 내가 superview에서 그것을 제거하고 나서 새로운 테이블이 올바르게 채워지지만 거기에 오래된 것을 ... 그래서 그것은 터치 이벤트를 얻을 수 있지만 그것을 다시 시작합니다. –
Imma 업로드 코드 –