mercredi 5 août 2015

Why: "Attempting to load .. while deallocating... :UISearchController:"


I have storyboard (ViewControllerA) that has a button that pushes ViewControllerB. VCB is

ViewControllerB has a "back" method as follows: (I've tried this both v1 and v2)

v1:

- (IBAction)back:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
completion:nil];
}

v2:
- (IBAction)back:(id)sender {
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}

Both methods give the following warning -- as well as some unexpected behavior.

The warning is:

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ()

I used Apple's sample (membership required) to add the new UISearchController.

I tried using the back methods in the base controller, the main controller and the search controller. All give me the same result.

Has anyone come across this? How do I resolve it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire