2

我收到此错误:

错误:“CLLocation”之前的预期“)”

使用此代码:

@protocol MyCLControllerDelegate <NSObject>
@required
- (void)locationUpdate:(CLLocation *)location; 
- (void)locationError:(NSError *)error;
@end

@interface MyCLController : NSObject <CLLocationManagerDelegate> {
    CLLocationManager *locationManager;
    id delegate;
}

@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, assign) id <MyCLControllerDelegate> delegate;

- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation;

- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *)error;

@end

代码,我认为很好,我认为问题是库,但我之前添加了框架但不起作用。

可能是什么问题?

4

1 回答 1

7

你导入了吗?

在文件顶部,执行:

#import <CoreLocation/CoreLocation.h>
于 2011-03-03T21:45:47.120 回答