IOS App Performance Optimization

Source: Internet
Author: User

1: Apply startup time when the app starts, load only the resources that are related to startup and must be loaded at startup.

2: Local image loading method local image loading common methods are two: (1), [UIImage imagenamed:@ ""] pictures used multiple times, you need to use this method to add the cache (2), [[UIImage alloc] initwithcontentsoffile:@ ""] pictures are not used frequently, do not use the cache

3: Do not block the main thread development in addition to UI processing, other tasks as far as possible in the background line preempted.

4:uiview (1), if your view is transparent, you need to set opaque to Yes. (2), use UITableView and Uicollectionview reuse, and cache the height of the dynamic cell. (3), delay loading not urgent need of views. (4), try to avoid clipping the picture if necessary in the background thread processing.

5: Cache cache requires repeated display of data, such as network requests, pictures.

6: Avoid excessive consumption of resources when creating objects assuming that the application is used more than once to date processing, the date objects are kept globally unique.

7: Releasing the object (1), when too many objects are created in the arc, the memory continues to rise, and when needed, an automatic free pool is added to free the unwanted resources. (2), release their own open memory space in time.

8: Prevent circular references (1), try to avoid importing the header file in the header file, use the @class declaration class, and #import in the. m file. (2), use the corresponding keyword to reference the object in the set proxy/block.

9: Data storage data storage roughly sub-plist, object archiving, SQLite. Nsuserdefault is suitable for storing small amounts of data, private information using keychain, SQLite suitable for a large number of data, archiving performance is low, try to avoid the use.

10: Memory warning handles three ways to release unnecessary data when the system issues a memory warning. Implement applicationdidreceivememorywarning Uiviewcontroller rewrite didreceivememorywarning in appdelegate Registration NOTICE: uiapplicationdidreceivememorywarningnotification

11: Performance Detection Static Analysis app: Menu-product-analyze can locate unused variables, memory leak analysis app takes time per operation: Instruments-time Profiler. Dynamic analysis of memory leaks: Instruments-leaks.

IOS App Performance Optimization

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.