Basically i have an array of Sprites to be loaded and removed one by one in an order. I have a list of animal names in an array like
const NSString *Animal1[30] = {@"Lion .png",@"Zebra .png",...........
To load a sprite i use the following code
image[i]= [Sprite spriteWithFile: [NSString stringWithFormat:@"%@",Animal1[i]]];
image[i].position = ccp( 240,180 );
[self addChild: image[i]];
Then to remove the sprite after use I use the following code
[self removeChild:image[i] cleanup:YES];
What happens when i run the code in simulator is the sprite loads one after other till 20th animal. After the 20th animals the application crashes. I dont know what is the problem.If i have the array less than 20 it works fine but when it exceed the application crashes. Can anyone plz help to resolve the issue.