[OC enhancement] simple knowledge points of SEL data types-related to methods

Source: Internet
Author: User

(1) methods in the class are converted into sel variables for storage.


(2) place a class to declare an object. When an object calls a method, the system converts the method to SEL and then uses this sel to perform matching in the class method.


(3) We can manually convert the method to Sel, and then use this sel to find the method.

# Import <Foundation/Foundation. h> # import "person. H "int main (INT argc, const char * argv []) {@ autoreleasepool {person * P1 = [[person alloc] init]; // normal method, you need to convert an eat to a sel, and then match and search for [P1 eat]; // use sel to convert the eat to a sel by ourselves, then use this sel to find sel [email protected] (EAT); [P1 performselector: AAA]; // merge and write it as [P1 performselector: @ selector (EAT)];} return 0 ;}


[OC enhancement] simple knowledge points of SEL data types-related to methods

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.