tags:

views:

828

answers:

1

I have TabBarView Controller, where i keep four tab bar items, let sat item1, item2, item3 and item 4. When clicking on item2 tab bar item, i call a RootViewController where it has a Navigation controller with a TableView and shows the row items. Upto here it is fine. When clicking on a row item, will have to launch a UIWebView to show the content.

I did code like below for this process.

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

 navigationController = [[UINavigationController alloc] init];
 webViewController = [[WebViewController alloc] init];
 [[self navigationController] pushViewController:webViewController animated:NO];
 [webViewController release];

}

The problem now is, clicking on a row item is not pushing the UIWebView code at all. I tested the UIWebView code with normal addSubView method like "[appDelegate.window addSubview:webViewController.view];" instead of calling via pushViewController. It is calling UIWebView and shows the web content successfully. I understand the problem should be calling as pushViewController:webViewController.

Can anyone point me what are the ways that it should be not be worked in this case and how can i correct it to make it work with pushViewController itself? I need to call UIWebView only using pushViewController. For such all these combination, is there any sample source available?

Waiting for someone's help.

thanks.

Clave/

+1  A: 

I think you are mistakenly creating a new navigation controller here

navigationController = [[UINavigationController alloc] init];

remove that line and use

[self.navigationController pushViewController:webViewController animated:NO];

instead of your reference above. That should do it :-)

Andiih
Thanks for the reply. I found the problem of mine and resolved already, which is nothing but, i didn't set my particular controller class as 'Navigation' in I.B in Tab Bar Controller Attributes properties.
Clave Martin