OBJECTIVE-C Study Notes

Source: Internet
Author: User

Super class

That is, the parent class can call the superclass method through [Super SetName: @ "a"]

Composite

Refers to an object that consists of several other objects

Object initialization
@interface*engine;)@end@implementation  Car-(ID)  init{  if(self =new]; }  return//init@end

To get the superclass to complete the desired one-time initialization, you need to invoke [Super Init]. Assigning the result of [super Init] to self is the standard practice of OC. Prevents the superclass from returning objects that are not the same as the objects originally created during initialization.

#import

1, import the system header file with <>, import the project local header file with ""

2, A.M. implementation need to #import "A.H"

3, @interface, A.M. can use @class Engine to tell the compiler will know what this is, implementation still need #import. #import会告诉编译器类的详细信息, and @class will only tell you that this is a class. The #import loop-dependent reference will be an error, and @class will not, a reference b,b reference a. You cannot use @class to reference a superclass in a subclass, because the compiler does not yet know the superclass information.

OBJECTIVE-C Study Notes

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.