Sorry, I punched the post before I was finished pasting my code. Let me try again. The error occurs at "@interface ClassB: ClassA". Another error occurs in ClassB implementation file when I set "x = 200;" The error I get is "Use of undeclared identifier 'x'". It is probably something simple but I cannot find it.
#import <Foundation/Foundation.h>
@interface ClassA : NSObject
{
int x;
}
-(void) initVar;
-(void) printVar;
@end
#import "ClassA.h"
@implementation ClassA
-(void) initVar
{
x = 100;
}
-(void) printVar
{
printf("x = %i", x);
}
@end
#import <Foundation/Foundation.h>
@interface ClassB: ClassA
-(void) initVar;
@end
#import "ClassB.h"
@implementation ClassB
-(void) initVar
{
x = 200;
}
@end