I have 2 page. first is tableView and second is view when I to click on any cell go on to next page (view) in way modal segue. I want add back button in next page of navigation bar . this is my code in view page : ViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.lable.text = obji.Name;
self.lable2.text = obji.Descript;
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(Back)];
self.navigationItem.leftBarButtonItem = backButton;
}
- (IBAction)Back
{
//I dont know that how return pervious page
}
As you said in your comment you use a modal controller
Add the following in viewWillappear
And in
Swift 3
I had similar issue, but I am using Swift. Here is the answer in Swift 2.2.