Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用GOOGLE-MAP-SDK的注释_Ios_Iphone_Google Maps_Google Maps Sdk Ios - Fatal编程技术网

Ios 使用GOOGLE-MAP-SDK的注释

Ios 使用GOOGLE-MAP-SDK的注释,ios,iphone,google-maps,google-maps-sdk-ios,Ios,Iphone,Google Maps,Google Maps Sdk Ios,我是iOS新手,正在使用GOOGLE-MAP-SDK。一切都进行得很顺利,但我无法在本例中使用注释,因为我无法找到我从谷歌placeAPI获取的位置 所以请帮我解决我的错误 代码文件 -(IBAction)search:(id)sender { NSString *url = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/search/json?location=30.7343000,76.

我是iOS新手,正在使用GOOGLE-MAP-SDK。一切都进行得很顺利,但我无法在本例中使用注释,因为我无法找到我从谷歌placeAPI获取的位置

所以请帮我解决我的错误

代码文件

-(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);

}

这是我将从中接收数据并希望在谷歌地图上显示的代码<代码>NSLog(@“谷歌数据:%@”,位置)正在给我输出

如果您可以发布一些代码,显示您希望在哪里检索您的职位,那么其他人可以进一步提供帮助。@DarrylBayliss好的,我将更新我的代码。。。。。