Dynamic type and dynamic binding, dynamic loading

Source: Internet
Author: User
 

1. iOS dynamic types and dynamic binding

NSObject * is the id type --- dynamic type

Dynamic binding: enable explicit reference of polymorphism-parent class pointer can point to subclass object

Method polymorphism: methods with the same name are implemented differently.

Dynamic binding is used to find the object type only when the program runs.

One is static loading and the other is dynamic loading.

2. Briefly describe your understanding of UIView, UIWindow, and CALayer


UIWindow is the window of a program. A program can have multiple windows, but the screen size is limited within the same time. Only one window can be displayed. The UIView displayed on the window can display the data, all people can see text, image, audio, and video in View mode, while CALayer is used to represent layer rendering. animation switching.

3. TCP/IP Socket

TCP is connection-oriented, that is, three-way handshake to establish a connection ----- http protocol, short connection, when the handshake is complete, start to transmit data, after the data transmission is complete .. disconnect

The UDP protocol is non-connection-oriented. Once a piece of data is sent, it does not matter. It is only responsible for sending the data. Whether the data can be accepted is not important, and the efficiency is high, but it is not secure.

Socket is the encapsulation of the TCP/IP protocol. It contains two important items: The first is the IP address, that is, the server address in our port, and the second is the port number, this determines what kind of service the server will provide when you request the server.

The server keeps listening at any time. You can understand that a is a server and B is a client.

A keeps listening at any time. When B has a request, it sends a request to a. Listening for a receives the message, returns the message, confirms the link, and checks the port number to provide a certain service and returns it.

4. Communication between classes and their advantages and disadvantages

Class-class communication-message sending and message sending mechanisms

Notification: one-to-many

Agent: clear

Block: The code is small and the implementation is simple, but the logic is not clear if the code is used.

Properties of the object accessed by string

4. Programs that can be run in the background

Audio location voip require blackfroud mothele (field) navigation, location, network phone

5. coreData is an encapsulation of databases and is actually object-oriented,

NSManagedObjectContext: the object context managed by NSManagedObjectContext is added, deleted, modified, and queried.

 

NSPersistentStoreCoordinator persistent storage assistant Baker

 

NSPertentStore: the person who persistently stores the data


NSMangedObjectModel description cake model of all entities

NSMangedObject

File raw materials

6. Performance Optimization

I personally feel that the most intolerable thing for users is the choppy UI.

Encapsulate code with code specifications to facilitate memory management

Asynchronous image loading and cache using SD (most used)

Handle memory warnings

Lazy loading

UIImage

Push notification (power saving)




Dynamic type and dynamic binding, dynamic loading

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.