I want to pass argument into google places url string. The string is
@"https://maps.googleapis.com/maps/api/place/search/xml?location=52.577798767,-2.124885567&radius=500&types=bank&sensor=false&key=AIzaSyCcC9pmri9XGOgyhjoHQq37cmcbfhjfghf6bBZe80"
i get no response. though i can get location updates. but i want to use this string in
-(void)ParseXML_of_Google_PlacesAPI { NSURL *googlePlacesURL = [NSURL
URLWithString:googleUrl]; NSData *xmlData = [NSData
dataWithContentsOfURL:googlePlacesURL]; xmlDocument = [[GDataXMLDocument
alloc]initWithData:xmlData options:0 error:nil]; NSArray *arr =
[xmlDocument.rootElement elementsForName:@"result"]; placesOutputArray=[[NSMutableArray
alloc]init]; for(GDataXMLElement *e in arr ) { [placesOutputArray addObject:e]; }
But not working. It gives no response.
Please suggest
Update:
This is my original code:
- (void)locationUpdate:(CLLocation *)location {
googleUrl= [[NSString alloc ]initWithFormat:@"https://maps.googleapis.com/maps/api/place
/search/xml?location=%f,%f&radius=500&name=money&sensor=false&
key=AIzaSyCcC9pmri9XGOgyhjoHQq37cmcdfsab6bBZe80",location.coordinate.latitude,location.coordinate.longitude];
}
Update 2
googleUrl= @"https://maps.googleapis.com/maps/api/place/search/xml?location=%f,%f&radius=500&name=the%20money&sensor=false&key=AIzaSyCcC9pmrisgd9XGOgyhjoHQq37cmcb6bBZe80",a,b;
This string is also not working. becaue.when i put a=@"9.281654854", and b=@"-3.32532", i.e. static values in a and b and use it it also does not show any location
I have updated my question and now using same thing as shown in question and following your advice. But still it does not show any location. though it ask me to click ok to access location data. when i click ok it does not show any location. My string is ok because when i put static coordinates and used as #define googleUrl=@"string". it works. but with dynimic coordinates it does not work