大家好,当我的应用程序处于后台时,我正在尝试获取位置更新。但是下面的代码似乎不起作用。IF 语句永远不正确。我还在 info.plist 文件中设置了必要的键。我在 iphone 3GS 和 ipad 3 中运行代码。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customizatio-n after application launch.
id locationValue = [launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey];
if (locationValue)
{
// create a new manager and start checking for sig changes
locManager = [[CLLocationManager alloc] init];
locManager.delegate = self;
[locManager startMonitoringSignificantLocationChanges];
return YES;
}