I have a table view with a lot of items
when i click on a cell in the table it loads a view with a web view outlet, in the web view in viewdidload i have this line of code to load the html file wich is in the project file

```
NSString *name = pagename.text;
[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:name ofType:@"html"]isDirectory:NO]]];

```

the code to push from the selected cell to that web view with is called Test is

```
if (indexPath.row == 0) 
{

    Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
    test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:test animated:YES];

    NSString *name1 = @"ba";
    [[test pagename] setText:[NSString stringWithString:(NSString *)name1]];

}

else if (indexPath.row == 1) 
{

    Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
    test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:test animated:YES];

    NSString *name1 = @"bb";
    [[test pagename] setText:[NSString stringWithString:(NSString *)name1]];

}

else if (indexPath.row == 2) 
{

    Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
    test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:test animated:YES];

    NSString *name1 = @"bc";
    [[test pagename] setText:[NSString stringWithString:(NSString *)name1]];

}

```

the html files are called ba,bb,bc and bd .html

the problem is when i select any cell of the four cells i have in the table it shows the same html file "ba.html"

i tried everything , cleaning the project, deleting the files and copying them back, changed the simulator, restarted the lap and even changed the files names.

any help ?

thanks in advance

update :

This is the hole code

```
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [array count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"CustomCell";

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

    [[cell textLabel] setTextAlignment:UITextAlignmentRight];

    cell.textLabel.text = [array objectAtIndex:indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:18];
    cell.textLabel.numberOfLines = 3;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    if (indexPath.row == 0) 
    {

        Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
        test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:test animated:YES];

        NSString *name1 = @"ba";
        [[test pagename] setText:name1];

    }

    else if (indexPath.row == 1) 
    {

        Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
        test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:test animated:YES];

        NSString *name1 = @"bb";
        [[test pagename] setText:name1];        
    }

    else if (indexPath.row == 2) 
    {

        Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
        test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:test animated:YES];

        NSString *name1 = @"bc";
        [[test pagename] setText:name1];
    }

    else if (indexPath.row == 3) 
    {

        Test *test = [[Test alloc] initWithNibName:nil bundle:nil];
        test.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:test animated:YES];

        NSString *name1 = @"bd";
        [[test pagename] setText:name1];

    }
}

```