uso externo en Xcode4

Estoy teniendo el siguiente error

Expected '{' before 'extern'

while using a third party header file and it has the following code

extern NSString *const kXXXError;

Is the usage related to Xcode version as currently i am using Xcode4

extern NSString *const kDeviceErrorDomain;

extern const NSInteger kDeviceErrorCodeUnknown;

@class DeviceInsightInternal;

@interface Device : NSObject {
    DeviceInternal *_internal;
}

- (id)init;

- (NSString*)collect:(NSError**)error;

@property (nonatomic, assign) BOOL allowsJavascript;

@property (nonatomic, assign) BOOL privacyEnabled;

@end

preguntado el 08 de noviembre de 11 a las 12:11

can u provide a little bit more of a verbose code? like the entire .h so that we can get a bit more of a clue. Anyway, did you check that the @interface Blah: UIWhatever has a { that closes right after the ivars declarations -

He actualizado la pregunta con el código. -

Looks like the problem is coming from before (maybe in one of your imports?). -

Sorry to ask..I am new to objective C.... can u tell me what you are refering to with "has a { that closes right after the ivars declarations " -

actually no imports ... its a third party header file given for usage in development.. -

1 Respuestas

You cannot declare a scalar property to have a any sort of retain,assign,copy semantic, it will result in a compile error. You should change:

@property(nonatomic, assign) BOOL allowsJavascript;
@property (nonatomic, assign) BOOL privacyEnabled;

a

@property(nonatomic) BOOL allowsJavascript;
@property (nonatomic) BOOL privacyEnabled;

respondido 08 nov., 11:16

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.