0

Cancel Button code for cancel button is

- (IBAction)cancelButton:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

While tracing the program I can see the method is called however the view is not dissmissing to the previous view controller.

Community
  • 1
  • 1
Rishab
  • 1,901
  • 2
  • 18
  • 34

1 Answers1

2

if you use Navigation View controller you should use

[self.navigationController popViewControllerAnimated:YES];

instead of dismissViewControllerAnimated

PS actually, I think you use storyboards and segues and in this case you should use UnwindSegue What are Unwind segues for and how do you use them? Also you should read some common documentation about in app navigation...

Community
  • 1
  • 1
Igor
  • 1,537
  • 10
  • 12
  • no popViewControllerAnimated found. When I use the full syntax I get `No visible @interface for 'AddConatctViewController' declares the selector 'popViewControllerAnimated:'` – Rishab Dec 16 '15 at 08:22
  • sorry, i've missed the navigationController. Check the fixed code – Igor Dec 16 '15 at 08:24
  • not the AddConatctViewController pop viewController, it's navigationController pop viewController – rose Dec 16 '15 at 08:32