The differences between class Extension and header file class extensions differ from header files

Source: Internet
Author: User

.

As the name suggests, they extend the class. A class Continuation is another name. The class extension is commonly used to declare private methods and properties. You want the class extension @implementation to is visible to the, and not in the header file.

Types and methods in the header file is generally intended to being public--available to any client.

Example:the property declared in the class extension won't be visible/accessible to clients who #import the header, but It'll be usable by the because the can see the declarations of the @implementation @implementation class extension.

So this can is used to emulate restricted access for your ivars and methods. This was useful because OBJC methods and properties cannot be specified as private/protected/public (e.g. using @public ).

Class extensions differ from categories primarily because extensions may declare storage (e.g. properties which would produ CE backing Ivars).

.

The differences between class Extension and header file class extensions differ from header files

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.