Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is not clear from your question how your app is structured, so this answer may not be the best solution for your problem but hopefully it gives you some idea of how your view controller hierarchy is likely built up from your app delegate.</p> <p>Lets say your first view controller class is named <code>FirstViewController</code>. Either your app delegate has a direct reference to an instance of this view controller, or it can access it through a parent view controller (perhaps via <code>window.rootViewController</code>).</p> <p>Now lets say you have a method in <code>FirstViewController</code> named <code>pushNextViewController</code> that performs the task of pushing the second table view controller.</p> <p>You can call that method from within the <code>application:handleOpenURL:</code> method of your app delegate.</p> <p>This might look something like:</p> <pre><code>[self.window.rootViewController.firstViewController pushNextViewController]; </code></pre> <p>There are other ways you could get a reference to your instance of <code>FirstViewController</code> and it would be cleaner if your <code>rootViewController</code> was a custom subclass so your could create a <code>pushNextViewController</code> method there and from that method tell your <code>FirstViewController</code> instance to <code>pushNextViewController</code>:</p> <pre><code>[self.window.rootViewController pushNextViewController]; </code></pre> <p>Note that in both examples above, you will need to cast the <code>rootViewController</code> to whatever class it is actually an instance of or the compiler will warn you that it does not have the property <code>firstViewController</code> (example 1) or the method <code>pushNextViewController</code> (example 2).</p> <p><strong>EDIT:</strong> If your <code>rootViewController</code> is a <code>UINavigationController</code>, then your code might look more like:</p> <pre><code>UINavigationController* navController = (UINavigationController*)window.rootViewController; FirstViewController* vc = navController.viewControllers[0]; [vc pushNextViewController]; </code></pre> <p><strong>EDIT 2:</strong> OK, It looks like the confusion here is that the <code>window</code> object has a <code>rootViewController</code> property (which appears to be pointing to your <code>navigationController</code>) and then you also have a <code>rootViewController</code> instance variable in your app delegate. These are two different objects, making your naming convention a bit confusing, but if I am right then the following should work:</p> <pre><code>- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { if ([[DBSession sharedSession] handleOpenURL:url]) { if ([[DBSession sharedSession] isLinked]) { [rootViewController PushView]; } return YES; } return NO; } </code></pre> <p>You should consider changing the name of your app delegate's reference to your <code>TableViewControllerForStorageList</code> to something other than <code>rootViewController</code> to alleviate some confusion.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload