在为iBeacon区域化时,monitoringDidFailForRegion,kCLErrorDomain错误5 [英] monitoringDidFailForRegion when regioning for iBeacon, kCLErrorDomain error 5

查看:227
本文介绍了在为iBeacon区域化时,monitoringDidFailForRegion,kCLErrorDomain错误5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个简单的应用程序,它使用iOS7.1中的CoreLocation来确定预先设置的iBeacon。

I am working on a simple App that uses CoreLocation in iOS7.1 to determine a pre-set iBeacon.

我的代码确实运行良好,直到它突然停止。我没有更改代码中的任何内容。

My Code did work very well until it suddenly stopped. I didn't change anything in the code.

在ViewDidLoad上开始监控后,monitoringDidFailForRegion上发生错误是kCLErrorDomain error 5:

The Error occured was "kCLErrorDomain error 5" on "monitoringDidFailForRegion" after start monitoring on "ViewDidLoad":

self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;

 NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"0E82E0A4-03FF-4A92-9C87-1F978917BD51"];
self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"com.henry.beacon"];
self.beaconRegion.notifyEntryStateOnDisplay = YES;

if ([CLLocationManager isMonitoringAvailableForClass:[CLBeaconRegion class]])
{
    NSLog(@"Monitoring is available.");
    [self.locationManager startMonitoringForRegion:self.beaconRegion];
    [self.locationManager requestStateForRegion:self.beaconRegion];
}

代表设置正确:

@interface ViewController : UIViewController <CLLocationManagerDelegate>

我检查了受监控区域的数量和

I checked the number of regions that are monitored and

[[self.locationManager monitoredRegions] count]

告诉我目前正在监测2个地区。奇怪。

showed me that 2 regions are currently being monitored. Strange.

唯一有帮助的是重置iOS设备(iPad Mini with iOS7.1)。之后,受监控区域的数量将恢复为1(这应该是正确的)。

The only thing that helped was resetting the iOS device (iPad Mini with iOS7.1). After that the number of monitored regions is back to 1 (which should be correct).

你们中的任何人遇到同样的情况我在代码中做错了什么吗?这是iOS 7.1中的错误吗?

Does anyone of you encounter the same and am I doing something wrong in my code? Is this a bug in iOS 7.1?

感谢您的任何评论/帮助。

Thanks for any comments / help.

Henry

更新:

我找到了关于此主题的另一个主题,它提供了一些有趣的见解:

I found another thread on this subject, which gave some interesting insights:

iBeacon:didRangeBeacons停止调用,必须重置设备才能再次使用

看起来好像真的是iOS7.1中的一个错误。感谢您对此的评论。

It seems as if it really is a bug in iOS7.1. Thanks for your comments on this.

推荐答案

检查您的蓝牙状态是打开还是关闭或蓝牙类型。可能是旧版蓝牙检查它。确保您的蓝牙在设备中打开。这为我解决了这个错误。谢谢

Check Your status of bluetooth is it open or close or type of Bluetooth. Might be old version of bluetooth check it. Make sure your bluetooth is open in device. This solve this error for me. Thanks

这篇关于在为iBeacon区域化时,monitoringDidFailForRegion,kCLErrorDomain错误5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆