2009-09-24 2 views
0

AtlasSprite를 부모 클래스로 사용하려고 시도하고 있지만 propleties에 오류가 있습니다. 마치 그들을 찾지 못하는 것 같습니다. 여기에 코드가 있습니다.AtlasSprite를 부모 클래스로 사용하기 - 클래스의 추천 정보에 문제가 있음

인터페이스 :

@interface Glyph : AtlasSprite{ 
    float eyelevel; 
} 
@property (readwrite,assign) float eyelevel; 
-(id) initWithMgr:(id) mgr; 

구현 : 그것은 [글리프 setEyelevel을 칠 때

AtlasSpriteManager *mgr = AtlasSpriteManager spriteManagerWithFile:@"atlas_glyph.png" capacity:3]; 
Glyph *glyph = [[Glyph alloc] initWithMgr:mgr]; 
[glyph setEyelevel:0]; 

그것은 계속 나를 위해 충돌 : 여기

@implementation Glyph 

@synthesize eyelevel; 
-(id) init { 
if((self=[super init])) { 
    eyelevel = 0; 
} 
return self; 
} 

-(id) initWithMgr:(id) mgr{ 
    if((self=[super init])) { 
     [self init]; 
     self = [AtlasSprite spriteWithRect:CGRectMake(0, 0, 119, 45) spriteManager: mgr]; 
    } 
    return self; 
} 

이 클래스에 대한 호출은 0 ]; 인스턴스에 대한 선택기를 인식하지 못한다고 말합니다. 어떤 도움이 필요합니까?

답변

0

@synthesize 문이 @property와 일치하지 않습니다.

@property (readwrite,assign) float currentEyeLvlY; 

하지만 당신과 세터를 합성 :

@synthesize currentEyeLvlY = eyelevel; 
:

@synthesize eyelevel; 

당신은 너무처럼 @synthesize의 관계를 정의 명시 적으로 일치, 또는 이러한 변수를 필요

관련 문제