小编mr.*_*osa的帖子

监控多个信标区域不起作用,开发人员已经说过可能吗?思考?(见我的代码)

这是我的代码:

    // Initialize and monitor regions
    for (NSString *serviceUUID in _serviceUUIDs) {
        // Initialize region
        NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:serviceUUID];
        CLBeaconRegion *appBeaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:SERVICE_IDENTIFIER];
        // Specify notifications
        appBeaconRegion.notifyEntryStateOnDisplay = YES;
        appBeaconRegion.notifyOnEntry = YES;
        appBeaconRegion.notifyOnExit = YES;
        // Add to regions
        [_appBeaconRegions addObject:appBeaconRegion];
        // Begin monitoring region and ranging beacons
        [_locationManager startMonitoringForRegion:appBeaconRegion];
        [_locationManager startRangingBeaconsInRegion:appBeaconRegion];
    }
Run Code Online (Sandbox Code Playgroud)

为了澄清," _ serviceUUIDs"是NSStrings的NSArray,包含五个UUID.我正在使用Locate iBeacons进行测试,并发现要添加的最后一个区域是唯一被检测到的区域.它似乎也是唯一被监控的人.我通过检查"_locationManager.monitoredRegions"来确定这一点.

这里有许多线程说可以监控多个信标区域.有谁想过为什么它不适合我?谢谢!

cllocationmanager ios clregion ios7 ibeacon

4
推荐指数
1
解决办法
3159
查看次数

标签 统计

cllocationmanager ×1

clregion ×1

ibeacon ×1

ios ×1

ios7 ×1