The difference between the two is:
1. import will contain all information about this class, including entity variables and methods, while @ class only tells the compiler that the name declared after it is the name of the class. As for how these classes are defined, don't worry about it for the moment. I will tell you later.
2. In the header file, you only need to know the name of the referenced class. You do not need to know its internal entity variables and methods. Therefore, in header files, @ class is generally used to declare this name as the class name. In the implementation class, because the internal object variables and methods of the referenced class are used, # import must be used to include the header file of the referenced class.
3. in terms of compilation efficiency, if you have 100 header files # imported the same header file, or these files are referenced in sequence, such as a-> B, B-> C, c-> D. When the header file at the beginning changes, all the classes that reference it later need to be re-compiled. If there are many classes, this will take a lot of time. Instead, @ class is not used.
4. if there is a circular dependency such as a-> B, B-> A, if # import is used to contain each other, a compilation error occurs, if @ class is used to declare each other in the header files of the two classes, no compilation error occurs.
Therefore, in general, @ class is placed in the interface, just to reference this class in the interface and use this class as a type. In the implementation class that implements this interface, if you need to reference the object variables or methods of this class, you still need to import the classes declared in @ class.