title: NSURL returning nil When Calling an API
body: <p>I'm trying to call an API and bring back menu items. My string seems to contain data because when I put it into a browser, I'm getting JSON.</p>
  
  <pre><code>NSString *urlString = [NSString stringWithFormat:@"https://api.nutritionix.com/v1_1/search/subway?results=0%3A20&amp;cal_min=0&amp;cal_max=50000&amp;fields=item_name%2Cbrand_name%2Citem_id%2Cbrand_id&amp;appId=MY_APP_ID&amp;appKey=MY_APP_KEY"];
  
  NSURL *url = [NSURL URLWithString:urlString];
  </code></pre>
  
  <p>My "urlString" contains a lot of information, but when I put a breakpoint on the NSURL object, it says it returns "nil".</p>
  
  <p>EDIT: Removed spaces however the error persists.</p>
  
  <pre><code>NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
  [request setHTTPMethod:@"GET"];
  [request setURL:[NSURL URLWithString:urlString]];
  
  NSHTTPURLResponse *responseCode = nil;
  NSError *error = [[NSError alloc] init];
  
  
  NSData *ResponseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;responseCode error:&amp;error];
  
  
  
  NSDictionary *dataDictionary = [NSJSONSerialization JSONObjectWithData:ResponseData options:kNilOptions error:nil];
  itemName = dataDictionary[@"item_name"];
  
  NSLog(@"%@", itemName);
  </code></pre>
  
  <p>EDIT: Added request code</p>