IPhone design patterns

Source: Internet
Author: User

I have never been particularly concerned about the Design Pattern in iOS development. I think this content is just a saying and cannot help programming much. Recently, based on iOS development, I suddenly felt that there was a problem with the above understanding. In fact, the understanding of the design model is a theoretical guide for iOS development. When you have a deep understanding of these design patterns, you will find that many function calling principles and object processing methods are well-founded. In this way, developers only need to think about the design mode and do not need to remember classes and objects with different names in the same way.

 

The design patterns involved in iPhone development are as follows:

1. MVC Mode

 

Model-View-controller mode: The view initiates a query and passes it to the model through the Controller. After the model changes, the view is notified to refresh the interface. Controller is the intermediary between model and view.

 

2. Object Sharing Mode

That is, the single-State mode of the shared object.

 

3. Target and Action Mode

Target and Action modes. Similar to sending a specific message to a specific object.

4. Notification Mode

Nsicationicationcenter Mode

5. Archive Mode

Nsarchive Mode

6. subview Mode

7. Delegation Mode

In the delegate mode, two objects are involved in processing the same request. The objects that receive the request are transferred to the delegate object for processing.

8. Proxy Mode

The key point is access control. This mode is implemented using nsproxy in iPhone development.

 

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.