У меня был этот вопрос раньше, попробовал как ответил, но все равно он не работает.iphone UIImage массив утечки памяти
Перед тем, как наделенный:
imageArray_danceright = [[NSArray alloc] initWithObjects:
Я пришел посоветовал сделать как сильфона, но теперь это крах немедленно после того, как второй аним называется:
//init areas:
imageArray_stand = [NSArray arrayWithObjects:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankieSingtRetime_0001" ofType:@"jpg"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankieSingtRetime_0002" ofType:@"jpg"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankiePeaceRetime_0003" ofType:@"jpg"]],nil];
imageArray_danceleft = [NSArray arrayWithObjects:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankiePeaceRetime_0001" ofType:@"jpg"]],
.. 40 images
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankiePeaceRetime_0040" ofType:@"jpg"]],nil];
imageArray_danceright = [NSArray arrayWithObjects:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankiePeaceRetime_0041" ofType:@"jpg"]],
.. 40 images
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"FrankiePeaceRetime_0080" ofType:@"jpg"]],nil];
//start:
[myimageview setAnimationImages:imageArray_stand];
myimageview.animationDuration = 0.23;
myimageview.contentMode = UIViewContentModeBottomLeft;
myimageview.animationRepeatCount = 0.0;
myimageview.image = [myimageview.animationImages objectAtIndex:1];
[myimageview startAnimating];
// ------ in my 'touchesBegan" i have:
if ([touch view] == overlay_fuesserechts) {
[myimageview.animationImages release];
[myimageview setAnimationImages:imageArray_danceright];
myimageview.animationDuration = 2.0;
myimageview.contentMode = UIViewContentModeBottomLeft;
myimageview.animationRepeatCount = 0;
[myimageview startAnimating];
}
- (void)dealloc {
[imageArray_stand release];
imageArray_stand=nil;
[imageArray_danceright release];
imageArray_danceright=nil;
[imageArray_danceleft release];
imageArray_danceleft=nil;
super dealloc];
}
Ее начинается с анимацией «стенд» .. но когда я стреляю, он мгновенно падает:
[myimageview setAnimationImages:imageArray_danceright];
и я понятия не имею. Я пробовал так много всего. Теперь я надеюсь, что у вас есть идея.
ТНХ Крисом
любой журнал @ console? –
нет .. это проблема .. это просто остановка. Я сделал NSLog до и после [myimageview setAnimationImages: imageArray_danceright]; по этой причине я знаю, что там разбился :) –