Domanda

Hi I am a newbie in iOS

In my project I didn't want to use a Navigation Bar because of the tint effect, so I used a container view to create something similar except for the back button I used an image with a button on the back.

I have used a Container View(connected to a Navigation Controller) to include a label and a button with an image on top of that button. I want the view to go back to the previous view when I click the button (the one inside the container view's navigation controller). I tried the usual [self.navigationController popViewControllerAnimated:YES]; but with no result. How do I execute this task?

È stato utile?

Soluzione

If you are using

[self presentViewController:yourVC animated:YES completion:nil];

to present your View Controller, then you should use

[self dismissViewControllerAnimated:YES completion:nil];

to dismiss your present View Controller and to go back to the last View Controller.

Altri suggerimenti

the view which you want to push to connect with UINavigation Controller pls clear that you is your app navigation based app, if not pls add it in App Delegate

ViewController *ViewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:ViewController] autorelease];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top