سؤال

Supposed I have a class declared as below:

// ClassB.h
#import "ClassA"

@class ClassC;
@interface ClassB : ClassA
@property (nonatomic, strong) ClassC *obj;
@end

The implementation file:

// ClassB.m
#import "ClassC.h"
#import "ClassD.h"
#import "ClassB.h"
...

The parent header file:

// ClassA.h
#import "ClassE.h"
@interface ClassA : NSObject
@end

Then modifications to which files would result in a recompilation for ClassB? (ClassA.h? ClassA.m? ClassC.h? ClassC.m? ClassD.h? ClassD.m? ClassE.h? ClassE.m?)

هل كانت مفيدة؟

المحلول

Changes to any the listed header files will cause ClassB to be recompiled.

I assume your ClassB.m file imports ClassB.h. With that and the C, D header imports; the A import in the B header; and the fact that the A header imports E header.

The only .m file that will cause a recompile of ClassB is ClassB.m.

Just follow the chain of which files are accessible from ClassB.m. Remember that imports suck in code from other files.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top