これは少し奇妙ですが、マップ領域を設定するために 2 日間連続して解決策を見つけようとしましたが、何も機能していないようです ここに私のコードがあります:
-(void)viewWillAppear:(BOOL)animated{
//[self step1locationupdate];
Maplocation.showsUserLocation=YES;
MKCoordinateRegion mapRegion;
mapRegion.center.longitude=self.currentProduct.shop.longcoordinate;
mapRegion.center.latitude=self.currentProduct.shop.latcoordinate;
NSLog(@"The USer Location are :%f",mapRegion.center.latitude);
mapRegion.span.latitudeDelta= 2;
mapRegion.span.longitudeDelta= 2;
[Maplocation setRegion:mapRegion animated:YES];
NSLog(@"The USer Location are :%f %f",Maplocation.userLocation.coordinate.latitude,Maplocation.userLocation.coordinate.longitude);
}
malocation.userlocation.coordinate の NSLog は、起動時に常に 0 です。同じコードをviewDidLoad部分に追加しましたが、違いはありませんでした
親切に助けて