UIImage-Animation, die App zu Abstürzen / Speicherlecks führt

Ich verwende eine UIImage-Animation, die zahlreiche Speicherverluste und Abstürze für verschiedene Benutzer verursacht, die die Anwendung verwenden.

Unten ist mein Code. Ich lade den Satz mit zwei Animationen in viewDidAppear vor

pointsView.image = [UIImage imageNamed: @ "C72.png"];

    NSMutableArray *menuanimationImages = [[NSMutableArray alloc] initWithCapacity:21];
    NSString *imageName;

    for( int aniCount = 0; aniCount < 72; aniCount++ )
    {
        imageName = [NSString stringWithFormat:@"C%d.png", aniCount];
        [menuanimationImages addObject:[UIImage imageNamed:imageName]];
    }

    pointsView.animationImages = menuanimationImages;

    pointsView2.image = [UIImage imageNamed:@"I72.png"];

    NSMutableArray *menuanimationImagess = [[NSMutableArray alloc] initWithCapacity:21];
    NSString *imageNames;

    for( int aniCounts = 0; aniCounts < 72; aniCounts++ )
    {
        imageNames = [NSString stringWithFormat:@"I%d.png", aniCounts];
        [menuanimationImagess addObject:[UIImage imageNamed:imageNames]];
    }

    pointsView2.animationImages = menuanimationImagess;
}

Ich starte dann die Animation mit

pointsView.animationDuration = 3.11;
pointsView.animationRepeatCount = 1;
[pointsView startAnimating];

Irgendwelche Vorschläge?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage