【发布时间】:2016-03-22 06:40:25
【问题描述】:
在我的项目中,我检测到信标设备。在委托方法中,它给出了空数组值
这给出了空数组值:
-(void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region{
NSLog(@"beacons list %@ ",beacons);
}
更新:
- (void)viewDidLoad
{
[super viewDidLoad];
NSUUID *uuid=[[NSUUID alloc]initWithUUIDString:UUID];
clBeconRegion=[[CLBeaconRegion alloc]initWithProximityUUID:uuid identifier:@"BluetoothExample"];
[locManager startMonitoringForRegion:clBeconRegion];
clBeconRegion.notifyEntryStateOnDisplay=YES;
}
【问题讨论】:
-
您是否为信标设置了正确的 UUID?
-
是的。我正在设置正确的 UUID
-
能否请您出示用于设置信标测距的代码?这应该包括:区域构建、设置 CLLocationManager 委托、请求位置权限以及在 .plist 文件中添加权限字符串。如果您可以验证您是否可以使用现成的检测器应用程序(如Locate)来检测传输信标,这也会很有帮助
-
我更新了问题
标签: objective-c cllocationmanager ibeacon