1
votes

I have a cell presenting a Passcode change view controller when tapped.

else if (indexPath.row == 2) {
                //Change passcode
                NSString *passcode = [[NSUserDefaults standardUserDefaults] stringForKey:@"passcode"];
                PAPasscodeViewController *passcodeViewController = [[PAPasscodeViewController alloc] initForAction:PasscodeActionChange];
                passcodeViewController.delegate = self;
                passcodeViewController.passcode = passcode;
                passcodeViewController.simple = YES;
                [self presentViewController:passcodeViewController animated:YES completion:nil];
                break;

            }

a delegate callback method to dismiss the Passcode change view controller when hit cancel:

- (void)PAPasscodeViewControllerDidCancel:(PAPasscodeViewController *)controller {
     [self dismissViewControllerAnimated:YES completion:nil];
//    [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
//    [self.navigationController popViewControllerAnimated:YES];

}

it does not however dismiss the Passcode change view controller when hit the cancel button even though xcode debug hits the code. I tried [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; it didn't work either. The presentingViewController property is nil.

It worked perfectly on iOS 6 before. Anyone ran into this problem before? Thanks

1
What's self.presentingViewController?Steven Fisher

1 Answers

0
votes

Your can try this in PAPasscodeViewController, instead of using the delegate,.

[self removeFromParentViewController];