我用我的预加载图像的泛滥代码:预载图片的iOS
NSMutableArray *test_loose_preload = [[NSMutableArray alloc] initWithCapacity:test_loose_array.count];
for (int aniCount = 0; aniCount < test_loose_array.count; aniCount++) {
UIImage *frameImage = [test_loose_array objectAtIndex:aniCount];
UIGraphicsBeginImageContext(frameImage.size);
CGRect rect = CGRectMake(0, 0, frameImage.size.width, frameImage.size.height);
[frameImage drawInRect:rect];
UIImage *renderedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[test_loose_preload addObject:renderedImage];
}
test_loose = test_loose_preload;
是否有可能以该块内检查的图像已预先加载,无需预装这一则更多?
感谢您的想法!
我不知道它是否完全符合您的需求,但WWDC 2012视频“构建,存档和提交您的应用程序”详细介绍了图像加载,以最大限度地减少用户的等待时间:https:// developer .apple.com/videos/wwdc/2012/ – j9suvak