uinavigationcontroller - iOS Programatically Drill Down Navigation Stack -
uinavigationcontroller - iOS Programatically Drill Down Navigation Stack -
i posted question before today regarding reacting receipt of force notification, whereby needed drill downwards 1 view another. question answered, have moved on requirement reacting force notifications, whereby need drill downwards 3rd level in navigation stack.
below mockup of view hierarchy, on receipt of force notification want drill downwards view titles "third view".
from reply previous question, able drill downwards "second view", when seek perform segue force "third view" on stack, same type of error per previous question:
terminating app due uncaught exception 'nsgenericexception', reason: 'could not find navigation controller segue 'admin'. force segues can used when source controller managed instance of uinavigationcontroller.'
in appdelegate, when receive notification select required tab then:
uinavigationcontroller *navcontroller = (uinavigationcontroller*)[_tabbarcontroller selectedviewcontroller]; nhprofileviewcontroller *profileviewcontroller = navcontroller.viewcontrollers[0]; [profileviewcontroller displayadminwebviewforpushnotification];
then in profileviewcontroller (first view) displayadminwebviewforpushnotification:
_displayadminforpushnotification = yes; [self performseguewithidentifier:@"settings" sender:self];
where "settings" "second view" in image above.
then in prepareforsegue:
if ([segue.identifier isequaltostring:@"settings"]) { nhsettingstableviewcontroller *settingsviewcontroller = segue.destinationviewcontroller; if (_displayadminforpushnotification) { [settingsviewcontroller displayadmin]; _displayadminforpushnotification = no; } }
up point fine, nail [settingsviewcontroller displayadmin]:
- (void)displayadmin { [self performseguewithidentifier:@"admin" sender:self]; }
it crashes. have done debugging , @ point settingsviewcontroller not have navigation controller (hence crash/error message). don't understand "first view" embedded in navigation controller.
your performing 3rd segue -- sec segue isn't done has no navigationcontroller.
delay using method perform action after segue: how execute code after segue done?
or utilize viewwillappear!
ios uinavigationcontroller segue uistoryboardsegue drilldown
Comments
Post a Comment