Reputation: 1
I am writing a simple program that uses an object *center from an XYPoint class as an instance variable.
@interface Circle : NSObject {
int radius;
XYPoint *center;
}
however, I get this error message when compiling the code:
error: expected specifier-qualifier-list before 'XYPoint'
how can I fix this?
Upvotes: 0
Views: 106
Reputation: 13612
In Circle.h, you need to declare the XYPoint class:
@class XYPoint;
Then, in Circle.m, import its full definition:
#import "XYPoint.h"
Upvotes: 3
Reputation: 9342
You need to include the appropriate header file that defines the XYPoint
class.
Upvotes: 1