We usually use [UIimage imagenamed:imagename] When we need to load a lot of pictures (photo albums);
actually [UIimage Imagenamed:imagename] This method will not be mutilated after the picture is used, the specific release time is determined by the system, this method is suitable for small pictures and some commonly used image processing.
when we do a simple picture browser we can not use this method, here is a simple approximate way to load the picture:
for (int i = 0; i<100; i++) {
NSString *imagename = [NSString stringwithformat:@ "img_%d", I];
NSString *path = [[NSBundle mainbundle] Pathforresource:imagename Oftype:nil];
UIImage *image = [UIImage Imagewithcontentsoffile:path];
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Imagenamed methods in iOS many pictures are taking up a lot of memory problems