What is NSObject?

Source: Internet
Author: User

What is NSObject?

NSObject is the root class inherited by most Objective-C classes; it has no parent class. Through NSObject, other classes inherit some basic interfaces with the Objective-C language compiler system, and obtain the ability to behave as an object in its instance.

Although NSObject is not a strict abstract class, it is actually a class. However, in addition to being a simple class, NSObject can hardly perform any useful operations. Add any attributes (attributes) for your program and develop the implementation logic. You must create one or more classes inherited from NSObject or the parent class inherited from NSObject ).

NSObject adopts the NSObject protocol (Protocol) (see "Root Class-and protocol" (page 67th )). NSObject protocol (protocol) can be used by multiple root classes. For example, NSProxy does not inherit NSObject from another root class, however, NSObject protocol is also used. Therefore, in Objective-C, NSObject has interfaces and functions similar to the NSObject class.

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.