1

I have some weird codes.

ClassA.h

// there is no import code
@protocol Album <Meta>
@end

@interface MyAlbum: VariantMeta <Album>
@end

What I know is this.

If I want to use any classes which are declared from outside of current file (in this case Meta and VariantMeta) I have to import those classes header files.

But Class.h can use Meta without imports any headers. There should be #import 'Meta.h'; in my understanding. But there is not!

Can I get any hints for understanding this situation? help me

thanks

Update

Class.m file looks like this.

// Class.m
#import <Framework/SomeHeaderWhichImportMetaHeaderFile>
#import "ClassA.h"

@implementation MyAlbum
@end

I guess this Class.m file's import, somehow, affects header file. but I don't know how it can be...

WoffOVkee
  • 273
  • 1
  • 10
  • Check if there is a file named `YourApp-Prefix.pch`, if yes, that's why. In a nutshell, it will add to all your files its list of imports (including also macros, etc.) https://stackoverflow.com/questions/23648593/what-is-prefix-pch-file-in-xcode – Larme Apr 09 '21 at 08:31
  • @Larme I searched a pch file and there is no such file. and I update my question. – WoffOVkee Apr 12 '21 at 13:01
  • Is `Meta.h` imported by `` or `ClassA.h`? Try `#import "ClassA.h"` before `#import `. – Willeke Apr 13 '21 at 10:12

0 Answers0