In my iPhone application…
In table view I am deleting the row…
updating the array from which I am feeding the table….
Reloading to data row….

x
Yes but Data which is deleted is proper..
Cell for Row at Index Path….
I have just added One Label to the row…
While deleting the row
I am just deleting the data from array
And Updating the count of the rows(decrementing)…
- (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;
}
EDIT ::Question of Overlapping the Labels Which has been patiallly solved.
Because now the label is not overlapped but
When I remove any row then that rows’ label remain same
—> the last row is not shown in the table.
The problem is that you keep adding a new label to the cell each time the cell is drawn.
try moving the following code into the
if (cell == nil) {..} block