使用 CLLocation 在选项卡应用程序中初始化 didUpdateUserLocation
我有这个选项卡栏应用程序,在第三个选项卡上有一个地图视图组件。 此方法
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
仅在用户查看/打开第三个选项卡后才调用 ,随后用户可以在应用程序中移动,并且当他的位置发生变化时,将调用该方法。我的问题是我想在用户不访问/初始化应用程序启动时的第三个选项卡的情况下初始分析/启用对该方法的调用...您可以在用户点击之前以编程方式强制实例化视图控制器吗选项卡?
I have this tab bar application with a map view component on the 3rd tab. This method
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
is only being call after the user has view/open the 3rd tab, subsequently the user can move around the app and when his location changes the method is being called. My problem is I would like to ininialyse/enable the calls on that method with out the user having visit/initialyse the 3rd tab on the startup of the app... can you programaticaly force instantiation of a view controller before the user taps on the tab ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
执行此操作的一个简单方法是暂时选择第三个选项卡,然后返回到
application:didFinishLaunchingWithOptions:
方法中的第一个选项卡:用户不应看到瞬时切换。
An easy way to do this is to temporarily select the 3rd tab and then go back to the 1st tab in the
application:didFinishLaunchingWithOptions:
method:The user should not see the momentary switch.