Bloqueo solo en iPad
Frecuentes
Visto 248 equipos
2
Tengo algunas animaciones en mi pantalla. Los estoy animando a todos a través de CAlayers usando hojas de sprites. Estoy descargando todos los activos que tienen un tamaño de 4 MB en viewDidAppear
método.
Puedo mostrar las animaciones tanto en simuladores como en iPhone. Pero recibiendo advertencias de memoria en iPad.
En los informes de fallas de mi dispositivo, se muestra el tipo de excepción como
EXC_BAD_ACCESS(SIGSEGV)
Estoy animando usando el siguiente código:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png", imageNameStr]]; UIImage *img = [UIImage imageWithContentsOfFile:getImagePath];
CGImageRef richterImgPl1 = [UIImage imageWithContentsOfFile:getImagePath].CGImage;
NSArray *arrayWithSprites = [img spritesWithSpriteSheetImage:img
spriteSize:CGSizeMake(230,350)];
CGSize fixedSize = CGSizeMake(230, 350);
MCSpriteLayer *richterPl1 = [MCSpriteLayer layerWithImage:richterImgPl1 sampleSize:fixedSize] ;
richterPl1.frame = imgView.frame;
richterPl1.position = imgView.layer.position;
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"sampleIndex"];
anim.fromValue = [NSNumber numberWithInt:1];
anim.toValue = [NSNumber numberWithInt:arrayWithSprites.count];
anim.duration = sleepTime;//[imgView.animationImages count] * 0.0500;
anim.repeatCount = 1;
[richterPl1 addAnimation:anim forKey:nil];
[self.view.layer addSublayer:richterPl1];
¿Alguna idea o pista para deshacerse de este problema?
1 Respuestas
0
debe responder a la advertencia de didReceiveMemory y liberar algunos recursos o su aplicación será eliminada por el sistema operativo, que es esta falla de segmento que está obteniendo
Respondido el 08 de diciembre de 12 a las 09:12
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas ios ipad or haz tu propia pregunta.
por favor muestra algo de código... - Yahia
Intenta configurar punto de interrupción de excepción en Xcode. Le mostrará la línea exacta que causó el accidente. - Adam
Intente activar los objetos NSZombie. Aquí es cómo : stackoverflow.com/questions/5386160/… - Mats
es un SEGFAULT, ¿lo entienden los zombis? - Daij-Djan
@Adam lo intenté agregando el punto de interrupción de excepción pero no sirvió. - Gani414