iOS Development Summary (A0)-imagewithname: With Imagewithcontentsoffile:

Source: Internet
Author: User

Reproduced:

Http://www.cnblogs.com/easonoutlook/archive/2012/12/17/2821648.html (from Easonoutlook)

[UIImage imagenamed:] Only suitable for the reading of the map with the UI interface, and some of the larger resource files should try to avoid using this interface.

Read the file path directly [UIImage Imagewithcontentsoffile] to solve the picture reading problem

The main differences between the two approaches are:

ImageName way will be in use when the system will cache, the programmer is unable to handle the cache, which is automatically processed by the system, for the repeated loading of the image, the speed will improve a lot, so the user experience is good. So if a picture needs to be used more than once in the app, or repeated references, the way to use imagename is better

Imagewithcontentsoffile, the system will be released after the use is complete and will not be cached, so there is no such problem. In general, all images will not be cached. Some of the pictures in the application only one or two times, you can use such a way, such as the Novice Guide screen pictures and so on, it is suitable for this way. There are no obvious boundaries.

 

iOS Development Summary (A0)-imagewithname: With Imagewithcontentsoffile:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.