delete row i uitableview working but cant reflect always on iphone
<p>i can successfuly delete data from tableview , but when i go to main menu and come back then i see all the old data,</p>

<p>how to make data consistent , i.e   once deleted it will be gone forever</p>

<pre><code>- (void)viewDidLoad
{
    [super viewDidLoad];
    appDelegate = (DatabaseTestAppDelegate *)[[UIApplication sharedApplication] delegate];

        {
     appDelegate.favDetail = [[NSMutableArray alloc] initWithObjects:@"1", @"2",@"4",nil];
        }

}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    appDelegate = (DatabaseTestAppDelegate *)[[UIApplication sharedApplication] delegate];



     NSString *cc=[appDelegate.favDetail objectAtIndex:indexPath.row];
    NSLog(@" vale is %d",indexPath.row);
    // Configure the cell...
     NSArray *theParameters = [cc componentsSeparatedByString:@","];



    NSLog(@"array is %@",cc);
          NSLog(@"arraytheParameters is %@",theParameters);

    cell.text=cc;//theParameters;
    return cell;
}



// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{   NSLog(@"matrix is her%@",appDelegate.favDetail);
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source



        [appDelegate.favDetail removeObjectAtIndex: indexPath.row];
        [tableView beginUpdates];
        [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject: indexPath] withRowAnimation:UITableViewRowAnimationFade];
        [tableView endUpdates];
    }   

     /*
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    } */


}



- (void)viewWillAppear:(BOOL)animated
{ [tableView reloadData];
    [super viewWillAppear:animated]; // no use , it shows old data
}
</code></pre>

<p>thanks</p>
