Objective-c: Runtime Runtime

Source: Internet
Author: User
Tags notification center

1. Is it possible to put more time-consuming operations in the notification Center?  

Notice in which line Cheng, then the processing of the notification event is carried out in the same thread;

if the asynchronous line Cheng the notification, then you can perform more time-consuming operations;if the Cheng of the main line is notified, then it is not possible to perform more time-consuming operations.  What is the difference between a 2.Foundation object and a Corefoundation object? when the foundation object is OC;the Corefoundation object is C;The Foundation object and the Corefoundation object can be converted to each other, and the conversion between data types· ARC: __bridge_retained, __bridge_transfer, Cfbridgingretain, cfbridgingrelease• Non-arc: __bridge  3. What is runtime?

1> Runtime is a set of underlying C language APIs (including many powerful and practical C-language data types, C-language functions)

2> Actually, we write the OC code, the bottom layer is based on the runtime implementation

* In other words, the OC code that we write at the end is turned into the underlying runtime code (c language Code)

What's the use of runtime?

1> can dynamically produce a class, a member variable, a method

2> can dynamically modify a class, a member variable, a method

3> can dynamically delete a class, a member variable, a method

Common functions, header files

#import <objc/runtime.h>: Member variables, classes, methods

Ivar * Class_copyivarlist: Get all member variables inside a class

Method * Class_copymethodlist: Get all the methods inside a class

Method Class_getinstancemethod: Get an instance approach (object method, minus-start)

Method Class_getclassmethod: Get a class approach (plus + start)

Method_exchangeimplementations: A specific implementation of 2 methods of exchange

#import <objc/message.h>: Messaging mechanisms

Objc_msgsend (...)

What is iOS swizzle? Implementation of 2 methods using run-time function exchange

Objective-c: Runtime Runtime

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.