title: How to use json data from localhost in objective-c?
body: <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
  
      NSURL *site_url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/json/data/post?sid=%@", SECURE, PASSCODE]];
  
      NSData *jsonData = [NSData dataWithContentsOfURL:site_url];
      NSError *error = nil;
      NSDictionary *dataDictionary = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&amp;error];
  
      self.items = dataDictionary;
  
  
  }
  </code></pre>
  
  <p>I am trying to parse json data. It works fine with data from the live server. However, when I change the link to <code>http://localhost:8090</code>. It stops working. </p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
  </code></pre>
  
  <p>I can access it from the data from the web browser. Does anyone know why is that?</p>