Azh*_*har 7 iphone objective-c cllocationmanager ios ios-simulator
我正在使用iphone模拟器4.2并尝试显示或NSLog标题和其他位置服务属性,例如纬度,经度,海拔高度,水平精度,垂直精度,速度.但它没有显示正确的参数和标题的标题实际上没有触发事件.作为其执行CLLocation代码
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
[self.delegate locationUpdate:newLocation];
}
Run Code Online (Sandbox Code Playgroud)
而不是执行CLHeading代码
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
[self.delegate headingUpdate:newHeading];
}
Run Code Online (Sandbox Code Playgroud)
当我在这两个代码上放置断点时,它从不接触CLHeading代码.我正在init中更新位置和标题.
- (id) init{
if (self!=nil) {
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
self.locationManager.distanceFilter = kCLDistanceFilterNone;
[self.locationManager startUpdatingLocation];
[self.locationManager startUpdatingHeading];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
问题是我不知道这是由于模拟器还是代码有问题?
请帮忙.
| 归档时间: |
|
| 查看次数: |
3964 次 |
| 最近记录: |