Objective c 未知类型名称';ESTBeaconRegion';;你是说';CLBeaconRegion';?

Objective c 未知类型名称';ESTBeaconRegion';;你是说';CLBeaconRegion';?,objective-c,xcode,ibeacon,estimote,Objective C,Xcode,Ibeacon,Estimote,问题1: 我跟随创建我自己的Estimote应用程序。然而,出现了这个错误: 未知类型名称“ESTBeaconRegion”;你是说“CLBeaconRegion”吗 如何解决 我已经包括了标题和代表 #import <EstimoteSDK/EstimoteSDK.h> @interface AppDelegate () <UIApplicationDelegate,CLLocationManagerDelegate,ESTBeaconManagerDelegate>

问题1:

我跟随创建我自己的Estimote应用程序。然而,出现了这个错误:

未知类型名称“ESTBeaconRegion”;你是说“CLBeaconRegion”吗

如何解决

我已经包括了标题和代表

#import <EstimoteSDK/EstimoteSDK.h>

@interface AppDelegate () <UIApplicationDelegate,CLLocationManagerDelegate,ESTBeaconManagerDelegate>
第二期: 为什么框架以红色突出显示

更新:(尝试胡安·冈萨雷斯建议的示例应用)

我在使用Estimote SDK库时遇到了同样的问题。不知什么原因,如果您试图在新的Xcode项目中包含SDK库,它似乎不会加载它。即使您使用CoreLocation和CoreBluetooth标头

我建议您使用示例代码来创建一个包含libaries的项目,然后开始修改它。

从下载的iOS SDK zip文件中下载代码,不要尝试从pod文件中导出代码,而可以直接使用从下载的iOS SDK zip文件导出的示例xcode项目。如果你遇到同样的问题,试一下。

来自heypiotr,“在SDK 3.0中,我们从ESTBeaconRegion切换到了CLBeaconRegion,您正在做的本教程尚未更新以反映这一点。不过这很简单:只需将所有ESTBeaconRegion事件更改为CLBeaconRegion。同时,我们还将ESTBeacon更改为CLBeacon,因此您可能还需要更换这些。”这就解释了一切。Thx伙计们!

如果您想在新的EstMote SDK 3.0中使用“旧应用程序”,我建议您阅读以下地址的迁移指南:

电子信标管理器

ESTBeaconManager类仍然存在,但功能范围较窄。在当前的形式中,它负责对iBeacon设备进行测距和监控,并与iBeacon一样进行广告宣传。它主要包括核心定位功能,但有一些有用的帮助工具,包括preventUnknownUpdateCount、avoidUnknownStateBeacons和ReturnallRangedBeaconStaton(已在以前版本的Estimote SDK中提供)

委托方法与CLBeacon对象(而不是ESTBeacon)和CLBeaconRegion(而不是ESTBeaconRegion)一起使用。让我们以测距委托为例:

SDK 2.4语法:

- (void)beaconManager:(ESTBeaconManager *)manager
      didRangeBeacons:(NSArray *)beacons
             inRegion:(ESTBeaconRegion *)region
{
    if (beacons.count > 0)
    {
        ESTBeacon *firstBeacon = [beacons objectAtIndex:0];
    }
}
SDK 3.0语法:

- (void)beaconManager:(id)manager
      didRangeBeacons:(NSArray *)beacons
             inRegion:(CLBeaconRegion *)region
{
    if (beacons.count > 0)
    {
        CLBeacon *firstBeacon = [beacons objectAtIndex:0];
    }
}

我希望这会对您有所帮助。

您建议使用哪种示例代码?我已尝试将此代码包含在“@property(nonatomic,strong)ESTBeaconRegion*beaconRegion;”“beacons”的“Examples”应用程序中。“beacons”的“Examples”应用程序中。但它不起作用……我在上面的问题中添加了错误截图。“Examples”应用程序"应用程序正在使用CLLocation而不是ESTBeaconRegion。没错,请使用Examples/beacons objective C项目并对其进行修改。在本例中,我使用了邻近示例代码,请记住在应用程序委派中设置凭据,以便您可以开始使用在Estimote Cloud中注册的信标。是的,稍后将执行此操作,我的Estimote仍与e courier。[ESTCloudManager setupAppID:nil和AppToken:nil];使用他们的SDK而不是使用CoreLocation有什么好处?因为我基本上可以用CLLocationManager替换ESTBeaconManager,用CLLocationWell替换ESTBeaconRegion,我建议使用他们的示例代码来让EstMote SDK正常工作。CoreLocation和CoreBluetooth都需要从头开始或使用示例代码。如果nt要制作一个通用信标应用程序(不是Estimote),那么你应该使用CLLocationManager和CLLocation。嗨,Mustafa Ibrahim,我已经包括了“#导入”和“#导入”AppDelegate.h”在AppDelegate.m文件中。这个问题的主要焦点是EstimoteSDK,它与appdelegateI没有任何关系。我遵循estimote网站上过时的教程。Thx提供了sdk3.0和2.4之间的比较
- (void)beaconManager:(id)manager
      didRangeBeacons:(NSArray *)beacons
             inRegion:(CLBeaconRegion *)region
{
    if (beacons.count > 0)
    {
        CLBeacon *firstBeacon = [beacons objectAtIndex:0];
    }
}