Minimize Importing Headers in Headers

  1. To compile anything that uses EOCPerson, you don’t need to know the full details about what an EOCEmployer is. All you need to know is that a class calledEOCEmployer exists. Fortunately, there is a way to tell the compiler this:
    @class EOCEmployer;
    
    在Person类里面如果只需要知道有Employer这个类存在可以用用上面的这种形式。如果还需要知道Employer里面的属性方法其它细节则在Person类的.m文件里面导入Employer的头文件(假设在 EOCPerson.h里面导入EOCEmployer.h的话,如果再有其他的类要导入EOCPerson.h那么EOCEmployer.h也会被导入,这样就会增加编译的时间)。