错误:在'CLLocation'之前预期')'

Rob*_*Bed 2 iphone objective-c cllocation ios

我收到此错误:

错误:在'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
Run Code Online (Sandbox Code Playgroud)

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

可能是什么问题?

Dan*_*Ray 6

你有进口吗?

在文件的顶部,转到:

#import <CoreLocation/CoreLocation.h>
Run Code Online (Sandbox Code Playgroud)