Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to get a json file from a website in iOS?
  2. NSString *urlString = [NSString stringWithFormat:@"http://maps.google.co.kr?q=%@&output=json",
  3.                        [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
  4.  
  5. NSString *content = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]
  6.                                                         encoding:NSKoreanEncoding  
  7.  
  8.                                                      error:&error];