title: Objective C: Segue back to root from NSObject class
body: <p>I've made an app that's an extension of our companys product. Users login with the same username and password as they would on our product (handled server-side).</p>
  
  <p>Essentially, as the user, you type "stuff" into the app in which you then send to the server. Each call to the server checks if the username and password is correct. (stored in core-data &amp; keychain)</p>
  
  <p>However if we get invalid password as a response (ex. if their superior have changed their password) the user should be removed from the app (I have already written code for this) <strong>AND segue to root view</strong>. &lt;- This is where I'm stuck.</p>
  
  <p>I have an NSObject class XYZUploader.m which handles responses from the server.
  Whenever we get the invalid password as a response I want to segue to root.</p>
  
  <p><a href="https://i.stack.imgur.com/gOVrk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gOVrk.png" alt="Overview"></a></p>
  
  <p>XYZUploader is not a viewcontroller that can be found above. It is just a NSObject class that handles responses (among other things). so a simple:</p>
  
  <pre><code>[self.navigationController popToRootViewControllerAnimated:YES];
  </code></pre>
  
  <p>does not work. I get the error:</p>
  
  <pre><code>Property 'navigationController' not found on object of type 'XYZUploader'
  </code></pre>
  
  <p>I want to link(delegate?) XYZUploader to XYZiPad_Login (root, first viewcontroller above). So that I can call a function to segue back to root <strong>from whatever viewcontroller the user happens to be on at the time</strong></p>
  
  <p>How do I do this?</p>