I've got a view hierarchy that looks like this:
UINavigationController (navigationController)
---> UITableViewController (rootViewController)
------> ABPeoplePickerNavigationController (peoplePicker)
---------> UINavigationController (navCon)
------------> UIViewController (ruleBuilder)
App flow logic is: App starts, user presented with table view of data, user selects 'add' button, app presents peoplePicker, user selects contact, users selects contact property, peoplePicker passes contact info to ruleBuilder, user adjusts some parameters, user taps 'save.' At this point, the Core Data stack creates a new entity, sets the attributes and saves the entity to the store.
When that is done, I need to dismiss all the view controllers and return the user to rootViewController, which I assume means using
but I can't figure out how to get a reference to navigationController into ruleBuilder. It's declared as an IBOutlet in the app delegate. I tried
but all that got me was an error message about a nonexistent getter method. If I call
then the ruleBuilder is dismissed (great!) but the peoplePicker is now the top view (not great!) instead of the rootViewController. So, I tried adding
to the peoplePicker method, at the very end, just before returning - but that didn't work either. Actually crashed the app.
A shove in the right direction would be much appreciated.
UINavigationController (navigationController)
---> UITableViewController (rootViewController)
------> ABPeoplePickerNavigationController (peoplePicker)
---------> UINavigationController (navCon)
------------> UIViewController (ruleBuilder)
App flow logic is: App starts, user presented with table view of data, user selects 'add' button, app presents peoplePicker, user selects contact, users selects contact property, peoplePicker passes contact info to ruleBuilder, user adjusts some parameters, user taps 'save.' At this point, the Core Data stack creates a new entity, sets the attributes and saves the entity to the store.
When that is done, I need to dismiss all the view controllers and return the user to rootViewController, which I assume means using
Code:
[navigationController popToRootViewControllerAnimated:YES];
but I can't figure out how to get a reference to navigationController into ruleBuilder. It's declared as an IBOutlet in the app delegate. I tried
Code:
[[[UIApplication sharedApplication] delegate].navigationController
popToRootViewControllerAnimated:YES];
but all that got me was an error message about a nonexistent getter method. If I call
Code:
[super dismissModalViewControllerAnimated:YES];
then the ruleBuilder is dismissed (great!) but the peoplePicker is now the top view (not great!) instead of the rootViewController. So, I tried adding
Code:
[self dismissModalViewControllerAnimated:YES];
to the peoplePicker method, at the very end, just before returning - but that didn't work either. Actually crashed the app.
A shove in the right direction would be much appreciated.