你能帮助我吗,我该如何解决这个问题?
提前致谢
- (voID)locationManager:(CLLocationManager *)manager dIDUpdatetoLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ [self log:[Nsstring stringWithFormat:@"Background location %.06f %.06f %@",newLocation.coordinate.latitude,newLocation.coordinate.longitude,newLocation.timestamp]];}- (BOol)application:(UIApplication *)application dIDFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ID locationValue = [launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]; if (locationValue) { // create a new manager and start checking for sig changes [self log:@"dIDFinishLaunchingWithOptions location key"]; m_locManager = [[CLLocationManager alloc] init]; [self log:@"dIDFinishLaunchingWithOptions created manager"]; m_locManager.delegate = self; [self log:@"dIDFinishLaunchingWithOptions set delegate"]; [m_locManager startMonitoringSignificantLocationChanges]; [self log:@"dIDFinishLaunchingWithOptions monitoring sig changes"]; return YES; } [self log:@"dIDFinishLaunchingWithOptions"]; return YES;}- (voID)applicationWillResignActive:(UIApplication *)application { [self log:@"applicationWillResignActive"]; NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; [userDefaults setBool:vIEwController.m_significantSwitch.on forKey:@"significant"]; [userDefaults synchronize];} - (voID)applicationDIDEnterBackground:(UIApplication *)application { [self log:@"applicationDIDEnterBackground"]; [m_locManager startMonitoringSignificantLocationChanges];}- (voID)applicationWillEnterForeground:(UIApplication *)application { [self log:@"applicationWillEnterForeground"]; [m_locManager stopMonitoringSignificantLocationChanges];}- (voID)applicationDIDBecomeActive:(UIApplication *)application { [self log:@"applicationDIDBecomeActive"]; if (![window.subvIEws count]) { // Add the vIEw controller's vIEw to the window and display. [window addSubvIEw:vIEwController.vIEw]; [window makeKeyAndVisible]; NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; vIEwController.m_significantSwitch.on = [userDefaults boolForKey:@"significant"]; if (vIEwController.m_significantSwitch.on) [vIEwController actionSignificant:nil]; }}- (voID)applicationWillTerminate:(UIApplication *)application { [self log:@"applicationWillTerminate"]; [m_locManager startMonitoringSignificantLocationChanges];}解决方法 我的朋友,你走错了路.实际上,在iOS中杀死应用程序后,没有任何方法可以执行任务.你可以阅读这个 here in Apple documentation.
查找我的iPhone – 这是一个Apple应用程序,他们使用私有API来实现这一目标.这些类型的功能不适用于通用开发人员编程.
所以请不要走这条路.所有人都将徒劳无功.
希望这有助于你!
总结以上是内存溢出为你收集整理的iOS位置更新甚至应用程序都没有运行(比如找我的iphone)全部内容,希望文章能够帮你解决iOS位置更新甚至应用程序都没有运行(比如找我的iphone)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)