Main. m
/* Improt and include are both import files. The difference is: Include is only a simple copy, but before import, the system will determine whether the current file has an existing file. If it is not imported, otherwise, the */INT main (INT argc, const char * argv []) {@ autoreleasepool {// insert code here... nslog (@ "Hello, world! ");} Return 0 ;}
Student. h
// # Import "classes. H "/* @ class can solve the problem of mutual import @ Class: Tell the compiler that this class has been defined elsewhere, specific attributes and Methods unknown to the current file */<P style = "margin-top: 0px; margin-bottom: 0px; font-size: 15px; font-family: Menlo; min-Height: 18px; "> </P> <P style =" margin-top: 0px; margin-bottom: 0px; font-size: 15px; font-family: 'heiti SC light'; color: RGB (0,132, 0); "> </P> @ class classes; @ interface Student: nsobject {Classes * classes; // class}-(void) study;
Student. m
-(Void) study {nslog (@ "student learning ");}
Classes. h
// # Import "student. H "// Note: @ class cannot be used in the header file during inheritance. Only # import // @ class student; @ interface classes: nsobject {student * student ;}
The relationship between improt, include, and @ Class