Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我想弄清楚 locationManager 是否必须在 appDelegate 中才能在后台调用,或者 appDelegate 是否必须是 locationManager 委托才能使后台更新工作。
谢谢。
不,您的应用程序中的任何类都可以成为位置管理器委托。
它不一定要在 AppDelegate 中,但最好是在可以从 AppDelegate 访问的单例中,以便在后台访问。