Reputation: 971
I am programming a iPad application. In my UIViewController class, I am processing a button tapping through which I am displaying another view (UIWebView), by pushing it in UINavigationController.
The problem is though my view is getting pushed into UINavigationController and getting displayed, I am unable to see the "back" button in the Navigation bar.
I have not included the UINavigationController class in my AppDelegate, as I am trying to directly use UINavigationController from within my method. Below is my button tap processing code:
NSString *url = [imageDict valueForKey:strName];
UINavigationController *navigation = [[UINavigationController alloc]init];
[navigation setNavigationBarHidden:NO];
[self.view addSubview:navigation.view];
CarouselWebView *carouselWebView = [[CarouselWebView alloc] initWithNibName:@"CarouselWebView" bundle:nil];
carouselWebView.urlString = url;
carouselWebView.title=@"Carousel Web View";
[navigation pushViewController:carouselWebView animated:YES];
[carouselWebView release];
Please let me know what I am doing wrong here.
Thanks,
Upvotes: 1
Views: 174
Reputation: 1790
You will not get the Back button automatically, because your app believes that carouselWebView is the first view in the navigation controller's stack.
There are two ways you can handle this:
Upvotes: 3
Reputation: 8267
in the first view set the title and it should work
self.title = @"First view"
Upvotes: 0