OC learning summary differences between OC and C syntax

Source: Internet
Author: User

A message uses the code enclosed in square brackets to send commands to an object (a message is a function ).

Class class uses the. h and. M files to define the object type.

Attribute attributes allow us to easily define value functions and value assignment functions (getting and setting values of object member variables ).

Category allows us to add features to classes without creating subclasses.

Protocol definition class commitment response methods (similar to interfaces in Java/C # and other advanced languages ).

@ The compiler uses the @ compile command for various purposes.

^ Introduces the block concept in IOS. A block is an object that encapsulates a work unit (code segment) and can be executed at any time. The Escape Character (^) is used to identify a block.

 

In short, when OC is started to learn, it will feel strange and strange. After learning and using it, we will find the power of OC functions, use our sincerity and efforts to learn it well ~.

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.