Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

What is wrong with this Objective-C syntax?

@interface Test : NSObject {

@private
    -(int)testInt;
}

@end

What am I missing? The compiler generates 4 errors over it?
Avatar of kaufmed
kaufmed
Flag of United States of America image

Have you imported the appropriate header for NSObject? What are the errors listed?
Avatar of curiouswebster

ASKER

This compiles:

@interface AbstractQuery : NSObject

-(NSString*) name;
-(NSString*) question;
-(NSArray*) answers;
-(int) correctAnswerIndex;

@end

But this fails:

@interface AbstractQuery : NSObject {

@private
-(NSString*) name;
}
-(NSString*) question;
-(NSArray*) answers;
-(int) correctAnswerIndex;

@end

with the attached errors:
Errors.tiff
ASKER CERTIFIED SOLUTION
Avatar of dgk1
dgk1
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks