0

In objective c, How can have false condition in #if __has_include?

Like I tried this

#if __has_include(!"RNFileViewerManager.h")

but it says

Expected "FILENAME" or < FILENAME >

Invalid token at start of a preprocessor expression

Goal: I am getting duplicate symbol error and I only want to load my code if RNFileViewerManager doesn't exist

Alwaysblue
  • 9,948
  • 38
  • 121
  • 210
  • This might help: https://stackoverflow.com/questions/10880510/objective-c-preprocessor-directive-for-if-not – Cristik Sep 14 '21 at 13:58

1 Answers1

1

The correct way to use the method is

#if __has_include(<frmaework/filename.h>)
  something *h = [something new]
#else
  other *h = [other new]
#endif

Try this and check whether you are getting error or not.

Subhashis Pandey
  • 1,473
  • 1
  • 13
  • 16