Runtime of iOS

Source: Internet
Author: User

runtime    Introduction:        1. objective-c            Direct writing Objecti The VE-C code automatically translates the code into the appropriate struct and function during the program's run.         2. NSObject method NSObject method defines a number of methods used to directly invoke runtime inside the method             iskindofclass:;ismemberofclass:            respondstoselector:            conformstoprotocol:            methodforselector:        3 . Direct operation of the runtime method             Runtime system is a C-language static library that has many functions and struct data to import <objc/runtime.h>     CLASS:CLASS structure main storage class instance variable and instance method         OC After compilation class is represented by class to actually point to Objc_class structure         ISA: class methods and class variables that point to Metaclass (Meta Class) storage classes         Super_class: pointing to the parent class         meth Odlists: Methods for this class list         Ivars: Information about the member variables of a stored class     method: A function defined within the runtime to represent a method         Introduction:            SEL method_name: The method Selector's name is used to differentiate the method id                Get Sel method                     1, @selector ()   &NB Sp                 2, nsselectorfromstring ()                     3, sel_registername functions             char *method_types: Types store parameter types for methods and return value types             IMP Method_imp: points to the specific implementation of this method points to the location of the method in memory     Ivar: Instance variable       use         Get class name:class_getname        Get parent class name: Class_getsuperclass         Get instance variable size:class_getinstancesize         Get method Name: Method_getname         Get method implementation:method_getimplementation        Get method parameters and string of return value type: Method_ gettypeencoding        Get a method parameterNumber:method_getnumberofarguments        Setup implementation:method_setimplementation        Exchange two methods:method_exchangeimplementations        send messages:objc_msgsend        Add overrides One way:class_addmethod        Replace method:class_replacemethod        Get instance method: Class_ getinstancemethod        Get all instance methods:class_copymethodlist        Get the implementation of the method Imp:class _getmethodimplementation        Whether a query responds to a method:class_respondstoselector 

iOS runtime

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.