Note that there are some explanatory texts on larger screens.

plurals
  1. POIOS values passed to a view are lost or forgotten
    text
    copied!<p>This is my first app, and actually isn't even fully mine but rather involves re-working an existing app to add functionality.</p> <p>It involves a JSON feed which I'm successfully reading in and then trying to pass the value of a URL to a view. Here's the code from my app delegate that is successfully fired once the feed is read in:</p> <pre><code>- (void)JSONFetch:(MYJSONFetch *)fetch gotTheCollection:(id)collection { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; self.testViewController.feedURL = [NSURL URLWithString:[collection objectForKey:@"Listings"]]; [JSONFetch release]; JSONFetch = nil; } </code></pre> <p>Then in my testViewController I have this viewDidLoad method:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; if(self.feedURL) { [self startDownload]; } } </code></pre> <p>Eventhough, when I debug, the gotTheCollection method passes a value to the feedURL of the view, it then fails on the if(self feedURL) check within the view and thus the view never gets populated. </p> <p>As I'm so new to this code I've no idea if the sequence is wrong, or maybe it's how I'm passing the variable.</p> <p>I know the description is relatively vague but even on a basic level I don't know if this functionality works in objective C, it doesn't cause any errors though, just sits there not loading because it can't get the data.</p> <p>UPDATE: Definition of FeedURL follows, in the H file:</p> <pre><code>NSURL *feedURL; </code></pre> <p>then</p> <pre><code>@property (nonatomic, retain) NSURL *feedURL; </code></pre> <p>then in the M file:</p> <pre><code>@synthesize feedURL; </code></pre> <hr> <p>Thanks for the help guys, I finally decided to just restart the entire upgrade as the project had become a mess of reworked code and I couldn't be sure what worked and what didn't. As a result there's no clear answer to this but I imagine Franks was probably the closest so I'll mark that as the answer.</p>
 

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