IOS Face Questions

Source: Internet
Author: User

1. What are the sub-categories of calayer? Use?

2. What are the common Crash scenes?

3. How to use the @protocol and category @property

4. What is method swizzling?

5, how to make their own class with the copy modifier? How do I rewrite the setter with the Copy keyword?

6. What is the iOS signature mechanism about?

Answer:

1. What are the sub-categories of calayer? Use?

Cashaperlayer

Cagradientlayer: Color transitions

Caemitterylayer: Particle effects

Catransformlayer: Constructs a hierarchical 3D structure by adding depth of field to a layer.

Careplicatorlayer: Layer Copy

Cascrolllayer

Catiledlayer: Provides a way to save memory rendering overhead

Catextlayer:

Caeagllayer:

Avplayerlayer: Play Video

2. What are the common Crash scenes?

Array out of bounds

The Zombie object was accessed. Objects that have been released

Access the wild pointer. Exc_bad_access.

A method that does not exist is accessed. Unrecognized selector

Multithreading concurrent Operations

Release the timer before the timer next callback

3. How to use the @protocol and category @property

Objc_setassociatedobject/objc_setassociatedobject

4. What is method swizzling?

In short, it's a method exchange.

Calling a method in Objective-c is actually sending a message to an object, and the only way to find the message is by selector's name. By using the dynamic characteristics of objective-c, we can implement the corresponding method of the selector in the runtime, and achieve the purpose of linking to the method.

Each class has a list of methods, the name of the method and the method to implement the mapping relationship, the essence of selector is actually the method name, imp a bit like a function pointer, pointing to the specific method implementation, through selector can find the corresponding imp.

Selector--and corresponding IMP

Several ways to realize the Exchange method

Implementation of two methods using Method_exchangeimplementations Exchange

Implementation of using Class_replacemethod substitution method

Use Method_setimplementation to directly set up an imp for a method.

5, how to make their own class with the copy modifier? How do I rewrite the setter with the Copy keyword?

6. What is the iOS signature mechanism about?

5, how to make their own class with the copy modifier? How do I rewrite the setter with the Copy keyword?

The Nscopying protocol is required if you want the object you write to have a copy function. If a custom object is divided into a mutable version and an immutable version, then both the Nscopyiog and nsmutablecopying protocols are implemented.

6.

https://www.jianshu.com/p/ad29445eb91c

IOS Face Questions

Related Article

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.