iBeacon:notifyOnEntry = NO和notifyOnExit = NO,但是正在调用委托

时间:2017-02-16 08:52:32

标签: ios objective-c

我的代码:

for W = 0.2:0.1:1
theta = degtorad(30);
yP = feval(@EquationDerivs,theta,W)
end

yP =

    1.0324


yP =

  -115


yP =

    0.8400


yP =

    0.7679


yP =

  -115


yP =

    0.6549


yP =

    0.6099


yP =

  -115


yP =

    0.5359

>> 

但委托方法: 当我进入该地区并离开该地区时,我会调用self.beaconRegion = [[CLBeaconRegion alloc]initWithProximityUUID:UUID identifier:@"com.dtha.ibeacon"]; self.beaconRegion.notifyOnEntry = NO; self.beaconRegion.notifyOnExit = NO; self.beaconRegion.notifyEntryStateOnDisplay = YES; [self.locationManager startMonitoringForRegion:self.beaconRegion]; [self.locationManager requestStateForRegion:self.beaconRegion]; locationManager:didEnterRegion:,我不知道locationManager:didExitRegion:notifyOnEntry的作用是什么?

1 个答案:

答案 0 :(得分:0)

你不应该使用

self.beaconRegion.notifyEntryStateOnDisplay = YES;

.notifyEntryStateOnDisplay设置为YES时,会在启用信标时调用委托。

另外

[self.locationManager requestStateForRegion:self.beaconRegion];
不应该使用

,因为它会在退出信标区域时再次调用委托。

我建议你改用:

[self.locationManager startMonitoringForRegion:beaconRegion]
[self.locationManager startRangingBeaconsInRegion:beaconRegion]