В моем приложении для iPhone ...
В табличном представлении я удаляю строку ...
обновление массива, из которого я подаю таблицу ....
Перезагрузка в строку данных ....
![enter image description here](https://i.stack.imgur.com/mc8YM.png)
х
Да, но удаляемые данные верны ..
Ячейка для строки на пути индекса ....
Я только что добавил одну метку в строку ...
При удалении строки
Я просто удаляю данные из массива
И обновление количества строк (уменьшение) ...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
//Get the Log Id for the sections. From Section Array
int logID=0;
if(indexPath.row==0)
{
NSLog(@"Time Array %@",timeArray);
logID=[[[sectionArray objectAtIndex:indexPath.section] valueForKey:@"logID"] intValue];
NSPredicate *p=[NSPredicate predicateWithFormat:@"logID==%d",logID];
fillRows=nil;
fillRows= [[timeArray filteredArrayUsingPredicate:p] mutableCopy];
}
//Show Current Time.
//"If condition for not to go for Array Index Out of Bound".
if(indexPath.row<[fillRows count])
{
//Log CurrentTime
cell.textLabel.text=[[fillRows objectAtIndex:indexPath.row] valueForKey:@"logCurrentTime"];
//Log Duration.
UILabel *lblDuration=[[[UILabel alloc] initWithFrame:CGRectMake(110, 11, 60, 21)] autorelease] ;
lblDuration.text=[[fillRows objectAtIndex:indexPath.row] valueForKey:@"logDuration"];
[cell.contentView addSubview:lblDuration];
}
return cell;
}
РЕДАКТИРОВАТЬ :: Вопрос о наложении ярлыков, который был решительно решен.
Потому что теперь ярлык не перекрывается, а
Когда я удаляю любую строку, метка этих строк остается прежней
---> последняя строка не отображается в таблице.
См. Эту ссылку Ответ