_kCLLocationAccuracyHundredMeters引用...问题

时间:2011-07-31 15:36:24

标签: objective-c core-location

我不知道如何解决我的问题,我试图进行100次修改,但它仍然告诉我该消息:

  

_kCLLocationAccuracyHundredMeters',引自:   _kCLLocationAccuracyHundredMeters SetupViewController.o中的$ non_lazy_ptr   (也许你的意思是:_kCLLocationAccuracyHundredMeters $ non_lazy_ptr)

这是我的代码:

- (void)viewDidLoad {
    NSMutableArray *options = [NSMutableArray array];
    [options addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"AccuracyBest", @"AccuracyBest"), kAccuracyKey, [NSNumber numberWithDouble:kCLLocationAccuracyBest], kAccuracyValue, nil]];
    [options addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Accuracy10", @"Accuracy10"), kAccuracyKey, [NSNumber numberWithDouble:kCLLocationAccuracyNearestTenMeters], kAccuracyValue, nil]];
    [options addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Accuracy100", @"Accuracy100"), kAccuracyKey, [NSNumber numberWithDouble:kCLLocationAccuracyHundredMeters], kAccuracyValue, nil]];
    [options addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Accuracy1000", @"Accuracy1000"), kAccuracyKey, [NSNumber numberWithDouble:kCLLocationAccuracyKilometer], kAccuracyValue, nil]];
    [options addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Accuracy3000", @"Accuracy3000"), kAccuracyKey, [NSNumber numberWithDouble:kCLLocationAccuracyThreeKilometers], kAccuracyValue, nil]];
    self.accuracyOptions = options;
}

我在.m中有这些输入:

  

导入“SetupViewController.h”
  import< CoreLocation / CoreLocation.h>

我收到5个kCL ...距离的5个错误(米,百米,公里...)

你有解决方案吗?

非常感谢

1 个答案:

答案 0 :(得分:2)

看起来您没有将Core Location框架添加到项目中。有关如何在Xcode4中执行此操作的说明,请参阅this answer