我有以下代码:
在我的.h标头文件中:
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@interface Compass : UIViewController <CLLocationManagerDelegate> {
[...]
CLLocationManager *locationManager;
}
[...]
@property(nonatomic, retain) CLLocationManager *locationManager;
@end和我的.m文件:
#import "[FILENAME].h"
[...]
@synthesize locationManager;
- (void)viewDidLoad {
[super viewDidLoad];
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
if(locationManager.headingAvailable == NO) {
[...]
}
[...]
}我得到了以下关于“locationManager.headingAvailable”的错误消息:错误:请求成员“headingAvailable”在某个不是结构或联合的东西中
我已经将CoreLocation框架添加到我的应用程序中...有谁能帮帮我呢?
发布于 2009-07-28 12:11:07
此属性在iPhone OS 3.0及更高版本中可用。
你可能会尝试在2.2.1中使用它?
https://stackoverflow.com/questions/1192921
复制相似问题