是的,互联网接入和 GPS 是电池的两大消耗。我完全不知道您对正常的含义是什么,因为没有其他应用程序正在运行,您已经得出结论,这实际上就是发生的情况:) 假设您已经测试过没有运行任何应用程序并且每 15 次没有得到 1%分钟...
对于 adwhirl,当应用程序进入后台时它是否已经停止访问互联网是未知的,但您可以将其添加到您的 App Delegate:
- (void)applicationDidEnterBackground:(UIApplication *)application {
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/
[lm stopUpdatingLocation];
[adView ignoreAutoRefreshTimer]
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
/*
Called as part of transition from the background to the active state: here you can undo many of the changes made on entering the background.
*/
[adView doNotIgnoreAutoRefreshTimer]
[lm startUpdatingLocation];
}
(lm 和 adView 是 Location Manager 对象和 adWhirlView,两者都在 App Delegate 中声明。我发现通过我在 App Delegate 中创建的方法进行所有位置管理更有用。)