无需过早地对其进行优化。
最简单且可能是最好的解决方案是为您上面提到的图像制定命名约定。我实际上会在帧号的左侧添加零,这样你也可以处理更高的帧数。
即IMG_0001.png、IMG_0002.png等
使用第一个图像创建一个 UIImageView 并创建一个 frameIndex 变量,您将使用它来跟踪当前动画帧并加载正确的图像。
然后安排一个 NSTimer 以您想要的速率运行(即 1/15 == 15FPS、1/30 == 30FPS 等),并在每次 NSTimer 调用选择器时将 UIImageView 上的当前图像替换为新图像。
这是一个简单的例子:
- (void)startAnimation
{
    self.currentFrame = 0;
    self.animationTimer = [NSTimer scheduledTimerWithTimeInterval:1/30.f
                                                           target:self
                                                         selector:@selector(_switchImage:)
                                                         userInfo:nil
                                                          repeats:YES];
}
然后在_switchImage方法上:
- (void)_switchImage:(NSTimer*)timer
{
    NSString *filename = [NSString stringWithFormat:@"IMG_%04i", self.currentFrame];
    NSString *fullPath = [[NSBundle mainBundle] pathForResource:filename ofType:@"png"];
    @autoreleasepool {
        UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
        if (image) {
            self.animationImageView.image = image;
            self.currentFrame = self.currentFrame + 1;
            // If for any reason we reach the last animation frame, loop back to the beginning of the animation
            if (self.currentFrame > kLastAnimationFrame)
                self.currentFrame = 0;
        }
    }
}