Hi I am developing iphone/ipad Applications. I took one header.h and import all ViewControllers importing in that header.h. Then i just import header.h in all classes.
Like header.h contains
#import "loginViewController.h"
#import "signupviewController.h"
and i have imported #import header.h in all necessary view-controllers.
if i done like this, any memory issues occurred or not?
I know, in C language, if we done like above, all unnecessary code have to be included, What about in objective-c?
I googled, but i didn’t find the required answer.
please tell any one.
Thanks.
#importkeeps track of which headers have already been included and is ignored if a header is imported more than once in a compilation unit.This makes it unnecessary to use header guards.
The
#importline is only replaced by the contents of name file for the first time it is encountered.The bottom line is just use
#importinObjective-Cand don’t worry if you are importing headers more than once.#importensures that a file is only ever included once so that you never have a problem with recursive includes. But that is not the same case with #include.