views:

188

answers:

0

I have an iPad app with a UISplitView. In the Root View I have a two level UITableView (it takes its content from a plist). In the Detail View I have a UIWebView.

- (void)tableView:(UITableView *)tableView 
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//Get the dictionary of the selected data source.
NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];

//Get the children of the present item.
NSArray *Children = [dictionary objectForKey:@"Children"];
RootViewController *rvController = [[RootViewController alloc] init];
rvController.CurrentTitle = [dictionary objectForKey:@"Title"];
rvController.CurrentLevel = +1;


    //Push the new table view on the stack
    [self.navigationController pushViewController:rvController animated:YES];

    rvController.tableDataSource = Children;

    NSString *name = [NSString stringWithFormat:@"%@.rtfd.zip", rvController.CurrentTitle ];
    NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
    NSString* sourceFilePath = [resourcePath stringByAppendingPathComponent:name];
    NSURL* url = [NSURL fileURLWithPath:sourceFilePath isDirectory:NO];
    NSURLRequest* request = [NSURLRequest requestWithURL:url];
    [detailViewController.webView loadRequest:request];

}

That's how I want the UIWebView's content to be changed. If I name the .rtfd.zip file the same as a first level cell of the UITableView, it works, UIWebView's content changes. But this doesn't work with the second level UITableView.

What am I doing wrong?

Thanks in advance!