[英]Xcode app won't launch on ipod the first time I run, but will run the second time (no clean/build)
[英]Xcode: My user location doesn't show the first time I run the simulation but the second time it does
每當我第一次打開項目並單擊“構建並運行”時,應用程序將不會專注於當前用戶位置。 但是,如果我停止仿真並再次構建它並運行它,它將像我希望的那樣將焦點放在用戶位置上。 我不知道為什么這樣做,模擬器有問題還是我的代碼有問題?
super viewDidLoad];
self.mapview.showsUserLocation = YES;
self.mapview.delegate = self;
[self.mapview setUserTrackingMode:MKUserTrackingModeFollow animated:YES];
您是否嘗試了Debug-> Location Service? 嘗試這個
現在移動self.mapview.showsUserLocation = YES;
到最后一行。 這可以達到您的期望。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.