#include <>: For references to system files, the compiler looks for the file in the System files directory. #include "xx.h": for a user-defined file reference, the compiler will first go to the user directory to find, and then go to the installation directory, and finally to the system directory lookup. Note: #include: If Class A imports Class B, the header file of Class B imports the header file of Class A, so that a circular reference occurs. So we try not to import the user-defined class file in the. h file. h (But if there is an agent in the. h file, you can To import another. h directly in. h or you can write an. h file separately for the agent) and #import if Class A imports Class B, the header file of Class B is imported into Class A's header file, and a cross-import occurs. #import function and Include is basically the same, but it avoids the problem of duplicate references. So in OC we basically use import.
@class is typically used when you need to define a property of a certain type in the. h header file, to prevent the import of another. h file in the. h file, and to prevent the loop from being imported, but be sure to #import the corresponding. h file in. m after using @class in. h Note: Do not import. m files for another class in. m
Ios#import and # Include and @class usage