Hi,
I'm a newbie also and I thought this code you provided would be my answer but I'm having trouble making it work and hope you can help (have tried other things to no avail)
The problem I have is that the selection keeps loading from the first row of the second table regardless of the selection from the first table. Can you see what I may be missing?
I copied your code bit from above and inserted my values as such:
Any help greatly appreciated!!
- (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"];
if([Children count] == 0)
{
UIViewController *webViewController = [[[UIViewController alloc] init] autorelease];
UIWebView *uiWebView = [[[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)] autorelease];
if ([self.title isEqualToString:@"FirstRowTitleName"]){ //if the tableview row with this title is selected
if (indexPath.row == 0) { //then the first subrow should open this webview URL
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
} else if (indexPath.row == 1) { //the second subrow
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.amazon.com"]]];
} else { //any other subrows
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.yahoo.com"]]];
}
} else if ([self.title isEqualToString:@"Body Blitz"]){ //if the tableview row with this title is selected
if (indexPath.row == 0) { //then the first subrow will open this webview URL
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.coles.com.au"]]];
} else { //any other subrows will open this one
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.cdu.edu.au.html"]]];
}
}
else { // for any other top level tableview rows
if (indexPath.row == 0) { // the first subrow
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.ebay.com.au"]]];
} else { //any other subrows
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.ebay.com.au"]]];
}
}
uiWebView.scalesPageToFit = YES; // uiWebView - object of UiWebview
[webViewController.view addSubview: uiWebView];
[self.navigationController pushViewController:webViewController animated:YES];
}
else {
//Prepare to tableview.
RootViewController *rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
//Increment the Current View
rvController.CurrentLevel += 1;
//Set the title;
rvController.CurrentTitle = [dictionary objectForKey:@"Title"];
//Push the new table view on the stack
[self.navigationController pushViewController:rvController animated:YES];
rvController.tableDataSource = Children;
[rvController release];
}
}