jshah
jshah

Reputation: 1661

Adding Back Button to Navigation Bar Doesn't Work

I've added a navigation bar to my view controller and added text to the Back Button option under Attributes Inspector but I'm not getting a back button when I run the app.

Picture of the setting: https://i.sstatic.net/5xfdc.jpg

Picture of the storyboard: https://i.sstatic.net/ZGEsY.jpg

Picture of app when I run: https://i.sstatic.net/fV7Mh.jpg

Any suggestions?

Upvotes: 0

Views: 546

Answers (2)

Abhishek Sharma
Abhishek Sharma

Reputation: 3283

Embedded your controller in UINavigationController and then do your operation Push or pop or etc

 Controller * objController = [[Controller alloc] initWithNibName:@“controllernib” bundle:nil];
UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController: objController];

Upvotes: 0

SoniA
SoniA

Reputation: 158

Your View Controller should be embedded in a navigation Controller. By doing this a back button is added by default in the View Controller.

Upvotes: 2

Related Questions