我用我的預加載圖像的泛濫代碼:預載圖片的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