Below sample code never come out of while loop and its printing the number of running actions as 1 always. What I am missing?
Thanks in advance Krishna
-(id)init
{
if(self == [super init])
{
CCSPrite *mySprt = [CCSprite spriteWithFile:@"myFile.png"];
mySprt.position = ccp(160,240);
mySprt.tag = 331;
CCFadeTo *fadeSprt = [CCFadeTo actionWithDuration:20.0 opacity:0];
[mySprt runAction:fadeSprt];
[self addChild:mySprt];
[self checkActionCount];
}
return self;
}
-(void)checkActionCount
{
while([self getchildByTag:331].numberofrunningactions > 0)
{
NSLog(@"Number of actions = %d",[self getchildByTag:331].numberofrunningactions);
continue;
}
NSLog(@"Number of actions = %d",[self getchildByTag:331].numberofrunningactions);
}