How to solve Xcode 4.1 (LION) GPS error?

后端 未结 4 433
长情又很酷
长情又很酷 2020-12-12 19:17

My project worked perfectly on simulator+device,
but now, after upgrading to lion os and xcode 4.1, I get this error when gps is active

4条回答
  •  清歌不尽
    2020-12-12 19:28

    From the Big Nerd Ranch forum:

    @implementation CLLocationManager (TemporaryHack)
    - (void)hackLocationFix {
        CLLocation *location = [[CLLocation alloc] initWithLatitude:42 longitude:-50];
        [[self delegate] locationManager:self didUpdateToLocation:location fromLocation:nil];     
    }
    - (void)hackHeadingFix {
        [[self delegate] locationManager:self didUpdateHeading:(id)@"That way.."];
    }
    - (void)startUpdatingLocation {
        [self performSelector:@selector(hackLocationFix) withObject:nil afterDelay:0.1];
    }
    - (void)startUpdatingHeading {
        [self performSelector:@selector(hackHeadingFix) withObject:nil afterDelay:0.1];
    }
    @end
    

提交回复
热议问题