You are still using myimage = [UIImage imagenamed:@ "Icon.png"];
Title, is not everyone so easy to load the picture AH
MyImage = [UIImage imagenamed:@ "Icon.png"];
So be careful.
This method is OK in a few pictures, or the picture is very small program.
However, in a large number of programs loading pictures, please do not do so.
Why???????
This method looks at the top-level folder of the application bundle by the image of the supplied name. If a picture is found, mount the image to the iphone system cache. That means that the picture is (theoretically) placed in memory as the cache.
Imagine you have more pictures, what is the consequence of ""
Picture cache may not respond to memory warnings and release its objects
Therefore, when using the picture must be careful alloc and release
Recommended Use
NSString *path = [[NSBundle mainbundle] pathforresource:@ "icon" oftype:@ "PNG"];
MyImage = [UIImage Imagewithcontentsoffile:path];
But this method to pay attention, if there is high-definition picture, that is, @2x, you can not automatically get to, you grasp it, do the UI with Imagenamed, to deal with the large map do not load the
The picture is cached
Uiimageview *wallpaper = [[Uiimageview alloc] Initwithimage:
wallpaper = [UIImage imagenamed:@ "Icon.png"];
Do not cache pictures
Uiimageview *wallpaper = [[Uiimageview alloc] Initwithimage:
wallpaper = [UIImage imagewithcontentsoffile:@ "Icon.png"];
IOS Picture Loading