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?

John Doe
  • 2,225
  • 6
  • 16
  • 44

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,783
  • 1
  • 8
  • 11