![](/img/trans.png)
[英]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.