Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your main problem:</p> <blockquote> <p>I have retrieved JSON Data on the ViewController I preformed the request on, but it does not transfer over to other ViewControllers.</p> </blockquote> <p>The reason for this problem:</p> <pre><code>RightViewController *rightViewController = [[RightViewController alloc] init]; rightViewController.get_next_song = self.get_next_song; [self updateViewStuff]; </code></pre> <p>You are allocating and instantiating a brand new view controller, and then setting a property on it. After this, you never mention <code>rightViewController</code> again, and it will be deallocated when the completion block ends. Any time you alloc-init, you're making a new one, and if you don't use it, set it to a @property, or push it on a navigation controller, it will simply disappear.</p> <p>I don't know the rest of your app well enough to give you code to fix this, but here's a general idea for solving this type of problem:</p> <ul> <li>Make a new class (NSObject, not UIViewController), that deals with sending / receiving data. Put all the AFNetworking stuff here.</li> <li>When a view controller needs data, have it ask this new object for the data. The data should be given back to the view controller. The object can use saved data if it's available, or make a request using AFNetworking if it's not</li> </ul> <p>This way, none of your view controllers need to know about each other - you don't need to pass data along a chain, you can just access it from your data source whenever you need it.</p>
    singulars
    1. This table or related slice is empty.
    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