iphone - crash on animating the sprite from sprite sheet -


below code using

-(void)addsprites{      [[ccspriteframecache sharedspriteframecache] addspriteframeswithfile:@"image.plist"];      ccspritebatchnode *spritesheet = [ccspritebatchnode batchnodewithfile:@"image.png"];     [self addchild:spritesheet];     // load frames of our animation     nsmutablearray *walkanimframes = [nsmutablearray array];     for(int = 1; < 5; i++) {         [walkanimframes addobject:[[ccspriteframecache sharedspriteframecache] spriteframebyname:[nsstring stringwithformat:@"image%d.png", i]]];     }    // ccanimation *walkanim = [ccanimation animationwithframes:walkanimframes delay:0.1f];     ccanimation *walkanim = [ccanimation animationwithspriteframes:walkanimframes delay:0.20f];     // create sprite our bear      background = [ccsprite spritewithspriteframename:@"image1.png"];     background.position = ccp(280, 175);     self.walkaction = [ccrepeatforever actionwithaction:[ccanimate actionwithanimation:walkanim]];    //[_bear runaction:_walkaction];     [spritesheet addchild:background];   }  -(void)startanimation{      [background runaction:walkaction]; } 

but app crash on line

  [background runaction:walkaction]; 

the error message ccspriteframecache: trying use file 'fisherman.png' texture 2013-05-03 13:30:44.085 * assertion failure in -[ccsprite runaction:]terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'argument must non-nil'. tried calling action

 [background runaction:walkaction]; 

in -(void)addsprites{......} method still crash occurs same error.

can please me on issue?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -