location of places on the google-map fetched by an array - ios

Hello friends
Google-map-SDK
I am new to ios and working on the GOOGLE-MAP-SDK. and everything is going very well,but i am not able to use the annotations in this case due to which i am not able to locate my positions which i fetched from the placeAPI of the google.
So kindly help me out with my errors.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-(IBAction)search:(id)sender
{
NSString *url = [NSString stringWithFormat:#"https://maps.googleapis.com/maps/api/place/search/json?location=30.7343000,76.7933000&radius=500&types=food&name&sensor=true&key=AIzaSyCGeIN7gCxU8baq3e5eL0DU3_JHeWyKzic"];
//Formulate the string as URL object.
NSURL *googleRequestURL=[NSURL URLWithString:url];
// Retrieve the results of the URL.
dispatch_async(kBgQueue, ^{
NSData* data = [NSData dataWithContentsOfURL: googleRequestURL];
[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:&error];
//The results from Google will be an array obtained from the NSDictionary object with the key "results".
NSArray* places = [json objectForKey:#"results"];
//Write out the data to the console.
NSLog(#"Google Data: %#", places);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the code from which i will recive the data and want to display it on the googlemap.
NSLog(#"Google Data: %#", places); is giving me the out put...

...
NSArray *markerForplaces = [NSMutableArray arrayWithCapacity:[responseResults count]];
for (NSDictionary *dict in responseResults) {
GMSMarker *markerForplace = [self markerForGooglePlaceFromDictionary:dict error:nil];
if (markerForplace) {
[markerForplaces addObject:markerForplace];
markerForplace.map = self.mapView;
}
}
...
- (GMSMarker*)markerForGooglePlaceFromDictionary:(NSDictionary*)dict {
CLLocationCoordinate2D coordinate = [self coordinateForPlace:dict];
GMSMarker *marker = [GMSMarker markerWithPosition:coordinate];
marker.userInfo = dict; //save place
}
- (CLLocationCoordinate2D)coordinateForPlace:(NSDictionary*)dictionary {
NSDictionary *geo = [dictionary objectForKey:#"geometry"];
if ([geo isKindOfClass:[NSDictionary class]]) {
NSDictionary *loc = [geo objectForKey:#"location"];
if ([loc isKindOfClass:[NSDictionary class]]) {
NSString *lat = [loc objectForKey:#"lat"];
NSString *lng = [loc objectForKey:#"lng"];
return CLLocationCoordinate2DMake([lat doubleValue], [lng doubleValue]);
}
}
return CLLocationCoordinate2DMake(0, 0);
}

Related

How to parse nsdictionary data using nsserlization.?

I have dictionary data like this and one array on image.
{ "result":"Successful","data":{"id":"12","product_name":"12\" Round
Plate","sku":"ECOW12RP","description":"Diameter 12 inch x\tDepth 0.9
inch","price":"153.00","business_price":"365.00","image":[{"image":"1454499068ecow12rp_01.jpg"}],"pack_size":"20","business_pack_size":"50","category":"2,3","tax_class":"1","created":"2016-02-03","altered":"2016-02-03
17:52:58","status":"1","deleted":"0","arrange":"1","delivery":"150.00"}}
I want to parse all the key values from it. this is the code which i use for this task.
-(void)viewDidLoad
{
NSLog(#"d %ld", (long)id);
NSString* myNewString = [NSString stringWithFormat:#"%i", id];
NSURL *producturl = [NSURL URLWithString:#"http://dev1.brainpulse.org/ecoware1/webservices/product/" ];
NSURL *url = [NSURL URLWithString:myNewString relativeToURL:producturl];
NSData * imageData = [NSData dataWithContentsOfURL:url];
UIImage * productimage = [UIImage imageWithData:imageData];
NSURL *absURL = [url absoluteURL];
NSLog(#"absURL = %#", absURL);
NSURLRequest *request= [NSURLRequest requestWithURL:absURL];
[NSURLConnection connectionWithRequest:request delegate:self];
}
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(nonnull NSURLResponse *)response
{
data = [[NSMutableData alloc] init];
NSLog(#"Did receive response");
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)thedata
{
[data appendData:thedata];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSDictionary *dictionary = [[NSJSONSerialization JSONObjectWithData:data options:0 error:nil]objectForKey:#"data"];
NSLog(#"arr %#", dictionary);
[productdetail removeAllObjects];
for (NSString *tmp in dictionary)
NSMutableDictionary *temp = [NSMutableDictionary new];
[temp setObject:#"product_name" forKey:#"product_name"];
//[temp setObject:[tmp objectForKey:#"id"] forKey:#"id"];
// [temp setObject:[tmp objectForKey:#"image"] forKey:#"image"];
[productdetail addObject:temp];
NSLog(#"detail %#", productdetail);
}
I tried to parse string from nsdictionary with the help of for loop, but I get product details array null, i don't know why it not get key value.
i am parse data which is in nsdictionary but i have null array when i try to parse image array in this json data please look at this json data.
{"result":"Successful","data":{"id":"2","product_name":"6\" Round Plate","sku":"ECOW6RP","description":"Diameter 6.0 (inch) x Depth 0.6 (inch)\r\n\r\nPerfect for finger foods!","price":"42.89","business_price":"100.00","image":[{"image":"1454499251ecow6rp_01.jpg"}],"pack_size":"20","business_pack_size":"50","category":"2,3","tax_class":"1","created":"2016-01-19","altered":"2016-02-06 16:06:10","status":"1","deleted":"0","arrange":"1","delivery":"150.00"}}
try this
Option-1
NSDictionary *dictionary = [[NSJSONSerialization JSONObjectWithData:data options:0 error:nil]objectForKey:#"data"];
[productdetail removeAllObjects];
if (dictionary)
{
NSMutableDictionary *temp = [NSMutableDictionary new];
[temp setObject:[dictionary objectForKey:#"product_name"] forKey:#"product_name"];
[productdetail addObject:temp];
}
Regarding your specific question to get the product_name data into your dictionary, this will work
NSDictionary *dictionary = [[NSJSONSerialization JSONObjectWithData:data options:0 error:nil]objectForKey:#"data"];
NSMutableDictionary *temp = [NSMutableDictionary new];
if ([dictionary objectForKey:#"product_name"]){
[temp setObject:[dictionary objectForKey:#"product_name"] forKey:#"product_name"];
}
If you print out the dictionary you made, you should see it is in there.
NSLog(#"the temp dictionary value for ProductName: %#", [temp objectForKey:#"product_name"];

JSON Data Not Parsed in iOS

i am Newbie in iOS Development. I want to Parse an JSON Data From My WebServices for that I have written folliwing code
- (void)viewDidLoad
{
NSURL * url=[NSURL URLWithString:[NSString stringWithFormat:#"http://www.janvajevu.com/webservice/latest_post.php?page=%d",pageNum]];
dispatch_async(kBgQueue, ^{
data = [NSData dataWithContentsOfURL: url];
[self performSelectorOnMainThread:#selector(fetchedData:) withObject:data waitUntilDone:YES];
});
}
-(void)fetchedData:(NSData *)responsedata
{
if (responsedata.length > 0)
{
NSError* error;
self.json= [NSJSONSerialization JSONObjectWithData:responsedata options:kNilOptions error:&error];
if ([[_json objectForKey:#"data"] isKindOfClass:[NSArray class]])
{
NSArray *arr = (NSArray *)[_json objectForKey:#"data"];
[self.navuArray addObjectsFromArray:arr];
[self.navuTable reloadData];
NSLog(#"JSON Data %#",self.navuArray);
}
self.navuTable.hidden=FALSE;
}
Here Self.json is A JSON Dictionary and self.navuArray is my NSMutableArray when i print my Array then It returns Num. Please Give me Solution for it.
Its your navuArray that is not initialized before you are adding objects to it from array. Initialize it before you call for your data and then add objects to it.
Try this code
id jsonObject = [NSJSONSerialization JSONObjectWithData:webData options:kNilOptions error:&error];
table = [[UITableView alloc]init];
[dict objectForKey:#"data"];
NSArray *array = (NSArray *)jsonObject;
if ([[dict objectForKey:#"data"] isKindOfClass:[NSArray class]])
{
for(int i=0;i<[array count];i++)
{
dict1 = [array objectAtIndex:i];
[postIdArr addObject:[dict objectForKey:#"post_id]];
[postTitleArr addObject:[dict objectForKey:#"post_title"]];
[postTitleSlungArr addObject:[dict objectForKey:#"post_title_slug"]];
NSString *dateId = [dict objectForKey:#"post_date"];
NSArray *dateArray = [dateId componentsSeparatedByString:#" "];
[dateArrs addObject:[dateArray objectAtIndex:0]];
[timeArrs addObject:[dateArray objectAtIndex:1]];
//[dateIdArr addObject:[dict objectForKey:#"date"]];
[postViewsArr addObject:[dict objectForKey:#"post_views"]];
[imageArr addObject:[dict objectForKey:#"feature_image"]];
[shortArr addObject:[dict objectForKey:#"short_description"]];
[nameArr addObject:[dict objectForKey:#"author_name"]];
}

Store JSON output in NSArray

Good morning,
I'm trying to develop my first App and I'm using TableView in order to show my entries from a MySQL database and I'm having some trouble when I have to parse the JSON output.
I have already created the connection with my JSON, but now I need to save all the id in a single Array, all the user in another array, etc, etc. As you can see below in my second code, I need to store them in a NSArray. How can I do that?
That's my JSON
[{"id":"15","user":"1","imagen":"http:\/\/farmaventas.es\/images\/farmaventaslogo.png","date":"2014-09-13"}
,{"id":"16","user":"2","imagen":"http:\/\/revistavpc.es\/images\/vpclogo.png","date":"2014-11-11"}]
And that's my TableViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
NSString * urlString = [NSString stringWithFormat:#"http://website.com/service.php"];
NSURL * url = [NSURL URLWithString:urlString];
NSData * data = [NSData dataWithContentsOfURL:url];
NSError * error;
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
// Here I have to store my "user"
self.carMakes = [[NSArray alloc] initWithObjects: nil];
// Here I have to store my "imagen"
self.carModels = [[NSArray alloc] initWithObjects: nil];
}
Thanks in advance.
That's another solution with KVC
NSArray *carMakes = [json valueForKeyPath:#"#unionOfObjects.id"];
NSArray *carModels = [json valueForKeyPath:#"#unionOfObjects.user"];
First of all, you would want to fetch JSON on another thread, so you dont block your main thread with it:
#interface ViewController ()
#end
#implementation ViewController
-(void)viewDidLoad
{
[super viewDidLoad];
[self fetchJson];
}
-(void)fetchJson {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
NSString * urlString = [NSString stringWithFormat:#"http://website.com/service.php"];
NSURL * url = [NSURL URLWithString:urlString];
NSData * data = [NSData dataWithContentsOfURL:url];
NSError * error;
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
// I advice that you make your carModels mutable array and initialise it here,before start working with json
self.carModels = [[NSMutableArray alloc] init];
#try {
NSError *error;
NSMutableArray* json = [NSJSONSerialization
JSONObjectWithData:theData
options:NSJSONReadingMutableContainers|NSJSONReadingMutableLeaves
error:&error];
if (error){
NSLog(#"%#",[error localizedDescription]);
}
else{
for(int i=0;i<json.count;i++){
NSDictionary * jsonObject = [json objectAtIndex:i];
NSString* imagen = [jsonObject objectForKey:#"imagen"];
[carModel addObject:imagen];
}
dispatch_async(dispatch_get_main_queue(), ^{
// If you want to do anything after you're done loading json, do it here
}
});
}
NSMutableArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
// Here you have to store my "user"
self.userArray = [[NSMutableArray alloc]init];
for (NSDictionary *userInfo in json){
//get "user" from json
NSString* user = [userInfo objectForKey:#"user"];
//add to array
[userArray addObject:user];
}
You have use NSMutableArray to add object instead.
Since "json" is array of NSDictionary you can get iterate over it and add to arrays like this:
NSArray *json = #[#{#"id":#"15",#"user":#"1",#"imagen":#"http:\/\/farmaventas.es\/images\/farmaventaslogo.png",#"date":#"2014-09-13"},
#{#"id":#"16",#"user":#"2",#"imagen":#"http:\/\/revistavpc.es\/images\/vpclogo.png",#"date":#"2014-11-11"}];
NSArray *carMakes = [NSArray array];
NSArray *carModels = [NSArray array];
for (NSDictionary *dict in json) {
carMakes = [carMakes arrayByAddingObject:dict[#"id"]];
carModels = [carModels arrayByAddingObject:dict[#"user"]];
}
NSLog(#"%#",carMakes);
NSLog(#"%#",carModels);

How to know each route position between two locations on Google map iOS sdk

I am using Google map iOS sdk for getting direction.By this LINK help me to draw route between two points.Now i cannot give route instruction (e.g.: Turn Left,Turn right) to the end user. How to solve this issue?Please help me.Now i am using following code
//Request the url
-(void)getWayPoints:(CLLocationCoordinate2D )origin destinationIS:(CLLocationCoordinate2D)desti{
NSString *oLat = [NSString stringWithFormat:#"%f",origin.latitude];
NSString *oLong = [NSString stringWithFormat:#"%f",origin.longitude];
NSString *dLat = [NSString stringWithFormat:#"%f",desti.latitude];
NSString *dLong = [NSString stringWithFormat:#"%f",desti.longitude];
NSString *url = [NSString stringWithFormat:#"http://maps.googleapis.com/maps/api/directions/json?&origin=%#,%#&destination=%#,%#&sensor=false",oLat,oLong,dLat,dLong];
NSLog(#"url : %#", url);
CLLocationCoordinate2D position = CLLocationCoordinate2DMake(
origin.latitude,
origin.longitude);
GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.map = mapView_;
CLLocationCoordinate2D position1 = CLLocationCoordinate2DMake(
desti.latitude,
desti.longitude);
GMSMarker *marker1 = [GMSMarker markerWithPosition:position1];
marker1.map = mapView_;
NSURL *googleRequestURL=[NSURL URLWithString:url];
NSLog(#"googleRequestURL : %#", googleRequestURL);
dispatch_async(kBgQueue, ^{
NSData* data = [NSData dataWithContentsOfURL: googleRequestURL];
[self performSelectorOnMainThread:#selector(fetchedData:) withObject:data waitUntilDone:YES];
});
//Response from URL
- (void)fetchedData:(NSData *)responseData {
//parse out the json data
NSError* error;
// NSLog(#"responseData Data: %#", responseData);
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:responseData
options:kNilOptions
error:&error];
NSArray* places = [json objectForKey:#"routes"];
NSDictionary *routes = [json objectForKey:#"routes"][0];
NSDictionary *route = [routes objectForKey:#"overview_polyline"];
NSArray *routes1 = [json objectForKey:#"routes"];
NSArray *legs = [routes1[0] objectForKey:#"legs"];
NSLog(#"legs %#", legs);
NSArray *steps = [legs[0] objectForKey:#"steps"];
NSString *overview_route = [route objectForKey:#"points"];
GMSPath *path = [GMSPath pathFromEncodedPath:overview_route];
GMSPolyline *polyline = [GMSPolyline polylineWithPath:path];
polyline.strokeColor = [UIColor redColor];
polyline.strokeWidth = 5.f;
polyline.map = mapView_;
}
NSString *str=[NSString stringWithFormat:#"http://maps.googleapis.com/maps/api/directions/json?origin=%#&destination=%#&sensor=false",self.txtFrom.text,self.txtTo.text];
NSURL *url=[[NSURL alloc]initWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSError* error;
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSArray* latestLoans = [json objectForKey:#"routes"];
NSMutableDictionary *legs=[[[latestLoans objectAtIndex:0] objectForKey:#"legs"] objectAtIndex:0];
NSString *startLocation,*endLocation,*totalDistance,*totalDuration;
CLLocationCoordinate2D startLoc,endLoc;
startLocation = [legs objectForKey:#"start_address"];
endLocation = [legs objectForKey:#"end_address"];
totalDistance = [[legs objectForKey:#"distance"] objectForKey:#"text"];
totalDuration = [[legs objectForKey:#"duration"] objectForKey:#"text"];
startLoc=CLLocationCoordinate2DMake([[[legs objectForKey:#"start_location"] objectForKey:#"lat"] doubleValue], [[[legs objectForKey:#"start_location"] objectForKey:#"lng"] doubleValue]);
endLoc=CLLocationCoordinate2DMake([[[legs objectForKey:#"end_location"] objectForKey:#"lat"] doubleValue], [[[legs objectForKey:#"end_location"] objectForKey:#"lng"] doubleValue]);
NSArray *steps=[legs objectForKey:#"steps"];
NSMutableDictionary *tempDict;
if ([steps count]!=0) {
MKMapPoint* pointArr = malloc(sizeof(CLLocationCoordinate2D) * [steps count]+2);
[tv setText:#""];
for(int idx = 0; idx < [steps count]+2; idx++)
{
CLLocationCoordinate2D workingCoordinate;
if (idx==0) {
workingCoordinate=startLoc;
MKMapPoint point = MKMapPointForCoordinate(workingCoordinate);
pointArr[idx] = point;
[tv setText:[NSString stringWithFormat:#"%# %#",tv.text,#"START"]];
}
else if (idx==[steps count]+1){
workingCoordinate=endLoc;
MKMapPoint point = MKMapPointForCoordinate(workingCoordinate);
pointArr[idx+1] = point;
[tv setText:[NSString stringWithFormat:#"%# %#",tv.text,#"\nEND"]];
}
else{
MKPolyline *pol= [self polylineWithEncodedString:[[[steps objectAtIndex:idx-1] objectForKey:#"polyline"] objectForKey:#"points"]];
MKMapPoint point = *(pol.points);
pointArr[idx] = point;
[tv setText:[NSString stringWithFormat:#"%#\n\n%#",tv.text,[self flattenHTML:[[steps objectAtIndex:idx-1] objectForKey:#"html_instructions"]]]];
}
tempDict = nil;
}
// create the polyline based on the array of points.
[mapView removeOverlay:routeLine];
routeLine = [MKPolyline polylineWithPoints:pointArr count:[steps count]];
[mapView addOverlay:routeLine];
free(pointArr);
}
with following supporting methods:
-(NSArray*) calculateRoutesFrom:(NSString *) f to: (NSString ) t { NSString apiUrlStr = [NSString stringWithFormat:#"http://maps.google.com/maps?output=dragdir&saddr=%#&daddr=%#", f, t];
NSURL* apiUrl = [NSURL URLWithString:apiUrlStr];
NSLog(#"api url: %#", apiUrl);
NSString *apiResponse = [NSString stringWithContentsOfURL:apiUrl encoding:NSUTF8StringEncoding error:nil];
#try {
// TODO: better parsing. Regular expression?
NSInteger a = [apiResponse indexOf:#"points:\"" from:0];
NSInteger b = [apiResponse indexOf:#"\",levels:\"" from:a] - 10;
NSInteger c = [apiResponse indexOf:#"tooltipHtml:\"" from:0];
NSInteger d = [apiResponse indexOf:#"(" from:c];
NSInteger e = [apiResponse indexOf:#")\"" from:d] - 2;
NSString* info = [[apiResponse substringFrom:d to:e] stringByReplacingOccurrencesOfString:#"\\x26#160;" withString:#""];
NSLog(#"tooltip %#", info);
NSString* encodedPoints = [apiResponse substringFrom:a to:b];
return [self decodePolyLine:[encodedPoints mutableCopy]];
}
#catch (NSException * e) {
// TODO: show error
}
}

JSON Geocoding for iOS - parse latitude/longitude to address

I am trying to create an autocomplete addresses suggestion using JSON.
The problem that I am facing is that I can get the latitude and longitude from a the user types on the UISearchDisplay. However I am trying to parse this data to addresses names. I was trying to use reverse geocoding from Apple but with no success. I am receiving only one value.
I was using apple geocoding straight away but the results were not what I was expecting.
Here is the code:
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString{
NSError *error;
NSString *lookUpString = [NSString stringWithFormat:#"http://maps.googleapis.com/maps/api/geocode/json?address=%#&sensor=true", self.searchBar.text];
lookUpString = [lookUpString stringByReplacingOccurrencesOfString:#" " withString:#"+"];
NSData *jsonResponse = [NSData dataWithContentsOfURL:[NSURL URLWithString:lookUpString]];
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:jsonResponse options:kNilOptions error:&error];
self.locationArray = [[[jsonDict valueForKey:#"results"] valueForKey:#"geometry"] valueForKey:#"location"];
int total = self.locationArray.count;
for (int i = 0; i < total - 1; i++)
{
NSLog(#"locationArray count: %d", self.locationArray.count);
NSArray *localLocations;
localLocations = [self.locationArray objectAtIndex:i];
NSLog(#"%d",i);
NSString *latitudeString = [localLocations valueForKey:#"lat"];
NSString *longitudeString = [localLocations valueForKey:#"lng"];
NSLog(#"LatitudeString:%# & LongitudeString:%#", latitudeString, longitudeString);
NSString *statusString = [jsonDict valueForKey:#"status"];
NSLog(#"JSON Response Status:%#", statusString);
double latitude = 0.0;
double longitude = 0.0;
latitude = [latitudeString doubleValue];
longitude = [longitudeString doubleValue];
CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
[self.geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error){
[[self placemarks] addObject:placemarks];
NSLog(#"PLACEMARKS %d", self.placemarks.count);
}];
}
NSLog(#"Mutable array %d", self.placemarks.count);
[self.searchDisplayController.searchResultsTableView reloadData];
return NO;
}
The NSLog(#"PLACEMARKS %d", self.placemarks.count); only display once, in the end of the task.
Any suggestions?
I really was doing so much more than the necessary.
Here is my code now:
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString{
NSError *error;
NSString *lookUpString = [NSString stringWithFormat:#"http://maps.googleapis.com/maps/api/geocode/json?address=%#&components=country:AU&sensor=false", self.searchBar.text];
lookUpString = [lookUpString stringByReplacingOccurrencesOfString:#" " withString:#"+"];
NSData *jsonResponse = [NSData dataWithContentsOfURL:[NSURL URLWithString:lookUpString]];
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:jsonResponse options:kNilOptions error:&error];
self.locationArray = [[jsonDict valueForKey:#"results"] valueForKey:#"geometry"];
int total = self.locationArray.count;
NSLog(#"locationArray count: %d", self.locationArray.count);
for (int i = 0; i < total; i++)
{
NSString *statusString = [jsonDict valueForKey:#"status"];
NSLog(#"JSON Response Status:%#", statusString);
NSLog(#"Address: %#", [self.locationArray objectAtIndex:i]);
}
[self.searchDisplayController.searchResultsTableView reloadData];
return NO;
}

Resources