开发者

updating location in a controller while location manager initialized in other controller

开发者 https://www.devze.com 2022-12-08 23:26 出处:网络
I have a navigation stack. In the rootView I initialize the location manager, and I have the proper delegate methods settled.

I have a navigation stack. In the rootView I initialize the location manager, and I have the proper delegate methods settled. Then I push a view passing the current retrieved location. and everything works well

on the other if I push the view while the location is still loading the position of开发者_开发问答 an eventual better coordinate are not sent automatically and the pushed view need to be popped and repushed . How do I retrieve the uploaded coordinates without pop-push again?


You can add a method like -updateWithLocation: in each controller that needs updating and then call it in your location manager delegate (for controller that is currently on top). If you use UINavigationController you can easily access your top controller using its topViewController property.

0

精彩评论

暂无评论...
验证码 换一张
取 消