試試用此代碼。這可能對你有幫助。
URLManager *urlmanager = [[URLManager alloc] init];
urlmanager.delegate = self;
urlmanager.responseType = JSON_TYPE;
urlmanager.commandName = @"Search";
NSString *locationString = [NSString stringWithFormat:@"%f,%f",latitude,longitude];
//Location where you want to search
NSString *key = @"AIzaSyCNRpero6aM451X0IfgFHAd-Y3eJUssqoa8`enter code here`0E";
//This is the secret key which you will get from the Google API Console when you register your app.
NSString *radiuos = @"15000";
//This is the area within which you want to search
NSString *keyword = @"Hotel";//Search keyword you want to search
NSMutableDictionary *arguments = [[NSMutableDictionary alloc] init]; // zero argument
[arguments setValue:key forKey:@"key"];
[arguments setValue:locationString forKey:@"location"];
[arguments setValue:radiuos forKey:@"radius"];
[arguments setValue:@"true" forKey:@"sensor"];
[arguments setValue:keyword forKey:@"keyword"];
NSLog(@"Arguments are %@",arguments);
[urlmanager urlCallGetMethod:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json"] withParameters:arguments];
對不起,但不能在SO上討論。它的NDA。試試Apple開發者論壇。蘋果工程師有時會在那裏閒逛。 –
查看WWDC 2012視頻 - 這裏可能有些東西。他們做了類似的演示,但我不記得細節。道歉。 –
它不再是NDA,6.1包含了實際的代碼,但仍然沒有任何文檔。我不知道蘋果公司發生了什麼事情,他們曾經是記錄事物的最佳人選,現在他們正在成爲另一種「解釋也很麻煩」的人。 – Rob