Curnelious
Curnelious

Reputation: 1

if( (self=[super init] ) )?

why if i am trying to call animation function in cocos2d like this :

    -(id) init
    {
       if( (self=[super init] ) ) 
    {
    [self animation];

    }
        return self;
    }

its working great, but when i do this :

-(id) init
    {
      [self animation];
       if( (self=[super init] ) ) 
    {


    }
        return self;
    }

the animation is called but not being played ??? or i cant see it ?? i just cant understand that.

Upvotes: 0

Views: 445

Answers (1)

taskinoor
taskinoor

Reputation: 46037

It is natural that base class's init is doing something important that is required to run the animation. That's why when you are trying to run animation before calling init of base class animation is not playing.

Upvotes: 4

Related Questions