requestPanoramaNearCoordinate
谷歌地图 SDK 方法有问题吗?因为它卡在了while loop
。我写了循环,因为我想等待执行其余的方法,直到异步回调方法完成。但是 while 循环无限循环。是我的代码完全错误吗?
__block GMSPanorama *panPhoto = nil;
__block BOOL finished = NO;
[self.panoService requestPanoramaNearCoordinate:ranLatLng callback:^(GMSPanorama *panorama, NSError *error) {
NSLog(@"panorama: %@ error: %@", panorama, error);
panPhoto = panorama;
finished = YES;
}];
while (!finished) {
// Do nothing);
}
if (!panPhoto) return [self randomLatitudeLongitude];
return ranLatLng;
}