我不明白为什么会出现错误:使用未声明的标识符“KCLDistanceFilterNone”和“kCLLocationAccuracyHundredMeters”不断出现在我的 CoreLocation.m 文件夹中。即使我删除了“;”也有更多错误 从选择行。有人可以帮忙吗?
#import "CoreLocation.h"
@implementation CoreLocation : NSObject
- (NSString *)deviceLocation {
NSString *theLocation = [NSString stringWithFormat:@"latitude: %f longitude: %f", locationManager.location.coordinate.latitude, locationManager.location.coordinate.longitude];
return theLocation;
}
- (void)viewDidLoad
{
locationManager = [[locationManager alloc] init];
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
[locationManager startUpdatingLocation];
}
@end
另外,我会在我的 CoreLocation.m 文件夹中添加什么来补充它并为我的应用程序完成定位服务?