Вот мой код для запуска ViewController b из < /p>
Код: Выделить всё
in FirstCustomVC
-(void) launchSecondVC {
UIStoryboard *storyBoard = self.storyboard;
CustomVC * myVC =
[storyBoard instantiateViewControllerWithIdentifier:@"myvc"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController: CustomVC;
[self presentViewController:nav animated:YES completion:nil];
}
< /code>
После запуска ViewController B, и пользователь что -то делает, я хочу отклонить ViewController B и включить кнопку обратно в ViewController A. Я могу отклонить VCB, но у меня возникли проблемы с захватом ссылки на VCB, чтобы включить кнопку. Тем не менее, представляющий ViewController является контроллером навигации и не имеет свойства, которое мне нужно, поэтому он сбой, если я попытаюсь получить доступ к свойству. < /P>
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];//dismisses successfully
self.presentingViewController.myButton.enabled = YES;//crashes as the property is on the VC, not the nav
Подробнее здесь: https://stackoverflow.com/questions/795 ... ective-c-t