0

A key difference for me of QuickDialog is that a single .m file (settingsFormBuilder.m) can carry all of the code for multiple views in the navigation controller under the one root, as such it seems to get linked to one view controller (settingsViewController.m).

My issue is that when i click on a tableviewcell, the underlying view will get pushed and the viewWillAppear in settingsViewController.m will get hit. I wan't to insert an if statement in this viewWillAppear method to see if a particular rootElement is being pushed rather than another.

How can I create an if statement to determine if my 'userAccessRoot' is being loaded in viewWillAppear as opposed to say my 'deviceConfigRoot'?

For example I need something like this, but just can't find a code combination that will do it

- (void)viewWillAppear:(BOOL)animated {
       if ([self.root.activeRoot.key isEqualToString:"userAccessRoot"]) {
           //Do something
       }
       else {
       }
 }

Thanks in advance

msec
  • 252
  • 5
  • 20

1 Answers1

0

I figured out how to resolve the issue, it was more a lack of my understanding of how quickDialog works. In case someone else runs into this issue this is what to do.

The key is how you set the controllerName of your QRootElement. For all of my QRootElements I had the controllerName referencing the same .m file. For example:

userListRoot.controllerName = @"SettingsViewController"; userAccessRoot.controllerName = @"SettingsViewController";

For some reason I thought it had to be this way as the sample project seemed to be set up in a similar fashion. I simply needed to create a new class which was a subclass of QuickDialogController and point the controllerName to that. Now when that QRootElement is loaded everything operates through the created .m file being the "UserSettingsViewController". Therefore no need to try and figure out which root is initiating the viewWillAppear as long as you only link one QRootElement to one .m file as you normally would. Refer below for an example of how my QRootElements now have different controllerNames

userListRoot.controllerName = @"SettingsViewController"; userAccessRoot.controllerName = @"UserSettingsViewController";

msec
  • 252
  • 5
  • 20