ユーザーがピッカー ビューから場所を選択せずに [戻る] ボタンを押すと、GMSPlacePicker がクラッシュします。
エラー :
-[UIWindow _shouldAnimatePropertyWithKey:]: 割り当て解除されたインスタンスに送信されたメッセージ
コード:
- (void)findNearByPlace :(CLLocationCoordinate2D)center {
CLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(center.latitude + 0.001,
center.longitude + 0.001);
CLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(center.latitude - 0.001,
center.longitude - 0.001);
GMSCoordinateBounds *viewport = [[GMSCoordinateBounds alloc] initWithCoordinate:northEast
coordinate:southWest];
GMSPlacePickerConfig *config = [[GMSPlacePickerConfig alloc] initWithViewport:viewport];
_placePicker = [[GMSPlacePicker alloc] initWithConfig:config];
[_placePicker pickPlaceWithCallback:^(GMSPlace *place, NSError *error) {
if (error != nil) {
NSLog(@"Pick Place error %@", [error localizedDescription]);
return;
}
if (place != nil) {
NSLog(@"Place name:%@",place.formattedAddress);
placeName = place.name;
placeAddress = place.formattedAddress;
//hide previous marker
self.mapMarker.map = nil;
self.locaitonTitle = place.name;
self.locationAddress = place.formattedAddress;
self.mapMarker = [GMSMarker markerWithPosition:place.coordinate];
self.mapMarker.icon = [UIImage imageNamed:@"ic_ellipse_black.png"];
mapLattitude = place.coordinate.latitude;
mapLongitude = place.coordinate.longitude;
self.mapMarker.draggable = YES;
markerTag = @"2";
markerDefault = @"default";
self.mapMarker.userData = @{};
self.mapMarker.map = self.mapView_;
[self showLocationPopUp:placeName address:placeAddress withCoord:place.coordinate];
//[self showLocationFoundView];
} else {
[self addOwnLocation : longPressCoord];
NSLog(@"No Place is selected yet");
}
}];
}
解決策はありますか?