used by ‘@synthesize’ declaration must be an existing ivar

@interface内で変数を定義していない為に発生するエラー

■エラーが出る例

@interface Sample : NSObject
{
}

@property int age;
@property BOOL status;
@property (retain) NSString *name;
@property (retain) NSString *address;

■コンパイルが通る例

@interface Sample : NSObject
{
  int age;
  BOOL status;
  NSString *name;
  NSString *address;
}

@property int age;
@property BOOL status;
@property (retain) NSString *name;
@property (retain) NSString *address;

Comments are closed.