我正在尝试获取用户位置。我添加了coreLocation框架,并填充了起始位置方法和委托。 委托函数不会触发的问题。
LocationManager.h:
@interface LocationManager : NSObject<CLLocationManagerDelegate>
@property(strong,nonatomic)CLLocationManager *locationManager;
-(void)startLocaitonService;
@end
LocationManager.m:
@implementation LocationManager
-(void)startLocaitonService
{
_locationManager=[[CLLocationManager alloc]init];
_locationManager.delegate = self;
_locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
_locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[_locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
}
@end
我在委托函数中有一个断点,但没有任何反应
答案 0 :(得分:0)