J'ajoute une couche à ma scène et je veux vérifier quand elle est complètement chargée en définissant un booléen après mon initialisation appelé doneInitializing
à YES
. Mais j'ai besoin d'y accéder en quelque sorte ... Comment je fais ça?Comment accéder à la propriété de CCLayer?
LoadingScreen.h
@interface LoadingScreen : CCLayerColor{
CCLayer *hWL;
}
LoadingScreen.m
hWL = [HelloWorldLayer node];
[self addChild:hWL];
if(hWL.doneInitializing == YES){ // that is where I get stuck
//do something
}
Je ne peux pas accéder à la doneInitializing
variables ... POURQUOI?
HelloWorldLayer.h
@interface HelloWorldLayer : CCLayer
{
BOOL doneInitializing;
}
@property (nonatomic,readwrite) BOOL doneInitializing;
HelloWorldLayer.m
@synthesize doneInitializing;
Y at-il une meilleure approche pour atteindre cet objectif ??
Parfait. Merci :-) Je n'aurais pas pu y penser, mais c'est clair et évident, merci. –