hit counter

Timeline

My development logbook

How to Dismiss a Modal View Controller Which Is Created by a Segue in Storyboard?

A way to dismiss a modal view controller is to link the button to an IBAction like this:

1
2
3
- (IBAction)cancelAddItem:(UIBarButtonItem *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

But it does not work in storyboard anymore.

This is the solution:

1
2
3
- (IBAction)cancelAddItem:(UIBarButtonItem *)sender {
    [self dismissModalViewControllerAnimated:YES];
}