this subject is similar to another i wrote BUT is different .
strange things happen to me lately with cocos,things are just deleted .
i have a NSString value in cocos2d class, that is not nil inside animation function.
but when animation is done ,and she calls another function, it becomes null in that function.
-(void)animation
{
// animation loops .....
//......
CCAnimate *Action = [CCAnimate actionWithAnimation:dollAnimation];
//calling finish animation here :
id call=[CCCallFunc actionWithTarget:self selector:@selector(finishAnimation)];
id sequence=[CCSequence actions:Action,[CCHide action],call,nil];
[dollSprite runAction:sequence];
basic_pic=[rowInDataBase objectAtIndex:1] ;
NSLog(@"%@",basic_pic);
// here basic_pic has a good value!
}
//when animation is done(3sec) it calls this :
-(void)finishAnimation
{
NSLog(@"%@",basic_pic); // null ! ! !
NSLog(@"%@",rowInDataBase); // null ! ! !
}
how is that happen ???
basic_pic is NSString with no properties now.
i have to say that basic_pic gets his value frin array one function before animation, and when animation is being called,it still there,but next call to finish function,its gone!
Did you
retainyourbasic_picandrowInDataBase? If not, they were likely auto-released objects which got released when the current UIKit event completed.