title: Show JSON Info in UILabel
body: <p>I am getting JSON from World Weather Online and I'm trying to show the temperature in Fahrenheit in a label but when I run it, that label shows (null). The JSON shows fine in the console so I know it is pulling the right data. Any ideas?</p>
  
  <pre><code>#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
  #define weatherURL [NSURL URLWithString: @"http://api.worldweatheronline.com/free/v1/weather.ashx?q=47129&amp;format=json&amp;num_of_days=5&amp;date=today&amp;key=37a5fj42xpyptvjgkhrx5rwu"]
  
  #import "Weather.h"
  #import "WeatherLocation.h"
  
  @interface Weather ()
  
  @end
  
  @implementation Weather
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view from its nib.
  
      dispatch_async(kBgQueue, ^{
          NSData *data = [NSData dataWithContentsOfURL:weatherURL];
          [self performSelectorOnMainThread:@selector(fetchedData:) withObject:data waitUntilDone:YES];
      });
  }
  
  - (void)fetchedData:(NSData *)responseData
  {
      // parse out the JSON data
      NSError * error;
      NSDictionary *json = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&amp;error];
  
      NSArray *weather = [json objectForKey:@"data"];
  
      NSLog(@"weather: %@", weather);
  
      NSArray *temp = [json objectForKey:@"temp_F"];
  
      NSDictionary *weatherConditions = [temp objectAtIndex:0];
  
      NSString *tempF = [weatherConditions objectForKey:@"temp_F"];
  
      currentTemp.text = [NSString stringWithFormat:@"%@", tempF];
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p>Result of <code>NSLog(@"weather: %@", weather);</code></p>
  
  <pre><code>weather: {
      "current_condition" =     (
                  {
              cloudcover = 50;
              humidity = 83;
              "observation_time" = "11:28 AM";
              precipMM = "0.0";
              pressure = 1016;
              "temp_C" = 22;
              "temp_F" = 72;
              visibility = 13;
              weatherCode = 116;
              weatherDesc =             (
                                  {
                      value = "Partly Cloudy";
                  }
              );
              weatherIconUrl =             (
                                  {
                      value = "http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0002_sunny_intervals.png";
                  }
              );
              winddir16Point = N;
              winddirDegree = 0;
              windspeedKmph = 0;
              windspeedMiles = 0;
          }
      );
      request =     (
                  {
              query = 47129;
              type = Zipcode;
          }
      );
      weather =     (
                  {
              date = "2013-09-09";
              precipMM = "0.0";
              tempMaxC = 35;
              tempMaxF = 95;
              tempMinC = 21;
              tempMinF = 69;
              weatherCode = 113;
              weatherDesc =             (
                                  {
                      value = Sunny;
                  }
              );
              weatherIconUrl =             (
                                  {
                      value = "http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0001_sunny.png";
                  }
              );
              winddir16Point = SSW;
              winddirDegree = 210;
              winddirection = SSW;
              windspeedKmph = 12;
              windspeedMiles = 7;
          }
      );
  }
  </code></pre>
  
  <p>I was attempting to make this work with the code I posted.  If I use the weather array, the app crashes on <code>NSDictionary *weatherConditions = [weather objectAtIndex:0];</code> with <code>[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance 0xa158f70</code></p>
  
  <p>UPDATE:  I fixed the issue with it returning NULL for temp_F.</p>
  
  <p>Here is the current code:</p>
  
  <pre><code>- (void)fetchedData:(NSData *)responseData
  {
      // parse out the JSON data
      NSError * error;
      NSDictionary *json = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&amp;error];
  
      NSLog(@"JSON: %@", json);
  
      NSDictionary *data = [json objectForKey:@"data"];
      NSArray *currentConditions = [data objectForKey:@"current_condition"];
      NSDictionary *conditions = [currentConditions objectAtIndex:0];
  
      NSArray *icon = [data objectForKey:@"weatherIconUrl"];
      NSDictionary *weatherIcon = [icon objectAtIndex:0];
  
      NSString *tempF = [NSString stringWithFormat:@"%@\u00B0", [conditions objectForKey:@"temp_F"]];
      NSString *imageURL = [NSString stringWithFormat:@"%@", [weatherIcon objectForKey:@"value"]];
      NSURL *conditionIcon = [NSURL URLWithString:imageURL];
      NSData *imageData = [NSData dataWithContentsOfURL:conditionIcon];
      UIImage *conditionImage = [UIImage imageWithData:imageData];
  
      NSLog(@"Image URL: %@", imageURL);
      conditionsImage.image = conditionImage;
  
      NSLog(@"temp_F: %@", tempF);
  
      currentTemp.text = [NSString stringWithFormat:@"%@", tempF];
      [currentTemp setFont:[UIFont fontWithName:@"FranklinGothicStd-ExtraCond" size:72.0]];
  }
  </code></pre>
  
  <p>The only problem I'm having now is that the weatherIconUrl is returning NULL now and I'm not sure why.</p>