Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

DEBUG macro is not set in Xcode while running the project in debug mode

$
0
0

I created a new react-native project which spits out an Android project and an iOS project. I am using Swift, so I replace the AppDelegate.m and AppDelegate.h files with AppDelegate.swift. I use the DEBUG macro like this in the swift file but it is always set to false even in debug mode due to which I am not able to use it.

    #if DEBUG
      let jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackResource:nil)
    #else
      let jsCodeLocation = Bundle.main.url(forResource: "main", withExtension: "jsbundle")
    #endif

I searched for debug in Build Settings on Xcode and I found the below which seems to be set correctly.

enter image description here

How can I assure that the DEBUG macro is set while running the debug mode and not set otherwise. Thanks.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>