objective c - Load images to cache- make the iPad crash -
i loading many images cache, worked great in simulation till now, have tried on device - ipad2 , , crash, if after default screen loading sprites cache . app crash before starts .
so , have tried load on background , , happen that, not crash now, some-how see black rects instead of images have loaded cache , means maybe havnt loaded anyway .
this in init method of first class :
[self performselectorinbackground:@selector(loadspriteframes) withobject:nil];
//than
-(void)loadspriteframes { //pre load effects [[simpleaudioengine sharedengine] preloadeffect:@"badeffect.mp3"]; [[simpleaudioengine sharedengine] preloadeffect:@"hearteffect.mp3"]; [[simpleaudioengine sharedengine] preloadeffect:@"rewardbig.mp3"]; [[simpleaudioengine sharedengine] preloadbackgroundmusic:@"backgroundtraffic.mp3"]; //preload images needed animations [[cctexturecache sharedtexturecache] addimage:@"stopanim.png"]; [[cctexturecache sharedtexturecache] addimage:@"shanim.png"]; [[cctexturecache sharedtexturecache] addimage:@"happyanim.png"]; [[cctexturecache sharedtexturecache] addimage:@"grumpyanim.png"]; nslog(@"*****2"); //do log }