curiouswebster
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?
@private
-(int)testInt;
}
@end
What am I missing? The compiler generates 4 errors over it?
Have you imported the appropriate header for NSObject? What are the errors listed?
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
@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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks