我正在使用iBeacons,但遇到了一个小问题。CLLocationManager委托未调用
第一次使用时,用户需要赋予权限,然后我们下面被称为:
_locationManager = [[CLLocationManager alloc] init];
_locationManager.delegate = self;
[_locationManager requestAlwaysAuthorization];
不过,我预计将称为以下的委托方法:
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
NSLog(@"Auth status changed: %i", status);
if(status > 3){
// Check if we have to start monitoring beacons
NSLog(@"Do we need to initialise after auth given?");
//[self initialiseLocations];
}
}
我运行iOS 8.0.2,所以不知道这是否是一个错误
你是否设置了对locationManager的强引用,类似'@property(nonatomic,strong)CLLocationManager * locationManager;'? – 2014-10-10 18:36:48
不,但在全球范围内在.h文件中声明它。包含的类很强大,在appDelegate中定义。所有其他回调工作正常,只是这一个。 – 2014-10-10 19:16:36