Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What exactly is your problem?</p> <ul> <li>Fetching the data?</li> <li>Or parsing the JSON?</li> </ul> <pre class="lang-c prettyprint-override"><code>-(void)viewDidLoad{ [super viewDidLoad]; NSLog(@"viewdidload"); responseData = [[NSMutableData alloc] init]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC%7CSeattle&amp;destinations=San+Francisco%7CVictoria+BC&amp;mode=bicycling&amp;language=fr-FR&amp;sensor=false"]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { NSLog(@"didReceiveResponse"); [responseData setLength:0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { NSLog(@"didFailWithError"); } -(void)connectionDidFinishLoading:(NSURLConnection *)connection{ NSLog(@"connectionDidFinishLoading"); NSString* newStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; [self handleResponse:newStr]; // NSLog(@"%@",newStr); } -(void)handleResponse:(NSString *)string{ NSLog(@"responseData data is ---------&gt;%@",string); } </code></pre> <p>Try this. You sometimes referred to responceData, and sometimes to receiveData. I fixed that and the name of the method. Plus you were trying to log the responseData and not the String.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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