Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.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谷歌地图-GMSUserAddedPlace后端错误_Ios_Iphone_Google Maps_Sdk - Fatal编程技术网

iOS谷歌地图-GMSUserAddedPlace后端错误

iOS谷歌地图-GMSUserAddedPlace后端错误,ios,iphone,google-maps,sdk,Ios,Iphone,Google Maps,Sdk,我试图在ios中使用添加一个位置到Google地图,但我总是遇到一个“后端错误” 代码: 您可以尝试将类型数组更改为仅包含项。(例如,addPlace.types=[NSArray arrayWithObjects:@“食物”,nil];因为如果你的地方有多个类型,那么地方添加有时不起作用。是的,你是正确的。谢谢。我将类型数组减少为一种类型,现在它可以工作了。 GMSUserAddedPlace *addPlace = [[GMSUserAddedPlace alloc] init]

我试图在ios中使用添加一个位置到Google地图,但我总是遇到一个“后端错误”

代码:


您可以尝试将
类型
数组更改为仅包含项。(例如,
addPlace.types=[NSArray arrayWithObjects:@“食物”,nil];
因为如果你的地方有多个类型,那么地方添加有时不起作用。是的,你是正确的。谢谢。我将类型数组减少为一种类型,现在它可以工作了。
      GMSUserAddedPlace *addPlace = [[GMSUserAddedPlace alloc] init];
        addPlace.coordinate = CLLocationCoordinate2DMake(postCoordinates.latitude, postCoordinates.longitude);
        addPlace.address = address;
        addPlace.types = [NSArray arrayWithObjects:@"food", @"restaurant", @"establishment", nil];
        addPlace.name = textField.text;


        [_placesClient addPlace:addPlace callback:^(GMSPlace *place, NSError *error) {

            if (error != nil) {
               //here I get a google error which is titled 'backend error'
                NSLog(@"User Added Place error %@", [error localizedDescription]);
                return;
            }

            NSLog(@"Added place %@", place.placeId);

        }];