Hey,
When doing iOS development, usually you will two files: interface and implementation.
In the interface file you import what you want, like:
#import <UIKit/UIKit.h>
But in the implementation file, you don't import UIKit although you are using its classes, protocols ...
Why we don't import it?
Is it a rule in Objective-C that if you import a file in the interface file then you don't import it in the implementation file?
Thanks.
John Todd wrote:Hey,
When doing iOS development, usually you will two files: interface and implementation.
In the interface file you import what you want, like:
#import <UIKit/UIKit.h>
But in the implementation file, you don't import UIKit although you are using its classes, protocols ...
Why we don't import it?
Is it a rule in Objective-C that if you import a file in the interface file then you don't import it in the implementation file?
Thanks.
It is being imported into the implementation because the interface imports it and your implementation imports your interface.
C imports b which imports a, so c is importing a automatically.