1

Currently, if I create a header file in Xcode, it creates one with

#ifndef Types_h
#define Types_h

// .. 

But if I create a Cocoa class, then the header generated is of the form

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
// ..

Is #ifndef not required in the later case? Does Objective-C automatically include only headers once?

johndoe
  • 1,721
  • 3
  • 13
  • 33

1 Answers1

-1

If #ifndef Types_h is not present then if you import the same header multiple times in a file it will declare the same macros multiple times that are declared in Type.h file

lazyTank
  • 1,343
  • 1
  • 7
  • 11