试图让后台的位置更新无法正常工作

时间:2013-05-17 11:19:08

标签: iphone ios cllocationmanager

大家好我正在尝试在我的应用处于后台时更新位置信息。但是下面的代码似乎不起作用。 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;
    }

0 个答案:

没有答案