Var*_*pta 5 xcode ios react-native react-native-ios
我创建了一个新的 React-Native 项目,其中包含一个 Android 项目和一个 iOS 项目。我使用的是 Swift,因此我将AppDelegate.m和AppDelegate.h文件替换为AppDelegate.swift. 我在 swift 文件中使用DEBUG这样的宏,但即使在调试模式下它也始终设置为 false,因此我无法使用它。
#if DEBUG
let jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackResource:nil)
#else
let jsCodeLocation = Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
Run Code Online (Sandbox Code Playgroud)
debug我在 Xcode上搜索Build Settings,发现下面的内容似乎设置正确。
如何确保DEBUG在运行调试模式时设置宏,而不是在其他情况下设置宏。谢谢。
| 归档时间: |
|
| 查看次数: |
843 次 |
| 最近记录: |