1
CCAction * 동작 1; classA에 나는 classB에서 그 행동을 사용할 필요가있다.
classB의 다른 작업과 함께 action1을 실행해야합니다. 어떻게해야합니까? 다음과 같은 방법으로 작업했지만 작동하지 않았습니다.classB에서 classA의 CCAction을 어떻게 실행할 수 있습니까? 어떤 방법으로 사용할 수 있습니까?
warning: 'CCAction' may not respond to '+actionWithAction:'
여기에 classA와 classB가 있습니다.
@interface classA : CCLayer {
CCAction *ActionScale;
}
@property (nonatomic, retain)CCAction *ActionScale;
@end
#import "classA.h"
@implementation classA
@synthesize ActionScale;
-(id)init
{
if((self = [super init]))
{
...
ActionScale = [CCScaleBy actionWithDuration:1.0f scale:2.0];
}
return self;
}
//
@class classA;
@interface classB : CCLayer {
CCSprite *sprite1;
classA *object1;
}
@property(nonatomic, retain)classA *object1;
@end
#import "classB.h"
#import "classA.h"
@implementation classB
@synthesize object1;
-(id)init
{
if((self = [super init]))
{
...
...
id eggAction3 = [CCAction actionWithAction:object1.ActionScale];
}return self;
}
우리가 다른 클래스에 하나 개의 클래스의 CCAction에게 전화를 걸 때 사용합니다 어떤 방법 ClassB가
?감사합니다.