【问题标题】:Build fails due to errors in CLErrorDomain.h由于 CLErrorDomain.h 中的错误,构建失败
【发布时间】:2013-04-19 02:12:36
【问题描述】:

我已经能够在 XCode 中毫无问题地构建我的 iOS 应用程序,直到突然发生这种情况。在构建时,我在 CLErrorDomain.h 中遇到 2 个错误-

Redefinition of 'NSString' as different kind of symbol
Expected ';' after top level declarator

CLErrorDomain.h 是框架的一部分,我无法编辑或更改它。这是重新定义 NSString 的代码行-

extern NSString *const kCLErrorDomain;

我重新启动了 XCode,清理了我的项目,但它仍然在构建时给我同样的错误,无论我是为模拟器还是设备构建。

我应该寻找什么信息来弄清楚如何解决这个问题?

更新

我重置为旧的提交,并且一直在重建我所做的。在我添加此代码之前一直很好。这里是什么让 CLErrorDomain 报错?

mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,200)];
mapView.delegate = self;
[mapView showsUserLocation];
HotspotAnnotation *annotation = [[HotspotAnnotation alloc] initWitHotspot:_hotspot];
[mapView addAnnotation:annotation];

CLLocationCoordinate2D zoomLocation = _hotspot.coordinates.coordinate;
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 20000, 20000);
[mapView setRegion:viewRegion];

【问题讨论】:

  • 请贴出与错误相关的类的代码,否则很难说为什么会出现错误。

标签: iphone ios xcode mkmapview


【解决方案1】:

我想通了——我在定义枚举后忘记了分号。

如果其他人遇到这种情况,请先查看代码以确保其有效。

【讨论】:

    猜你喜欢
    • 2022-11-02
    • 1970-01-01
    • 2021-07-02
    • 2020-01-16
    • 1970-01-01
    • 1970-01-01
    • 2021-12-08
    • 2020-08-19
    • 2021-11-04
    相关资源
    最近更新 更多