项目打包去掉调试时的NSLog、print

在开发中,为了便于调试常用nslog 和 print , 可是这些输出会影响APP的性能,xcode中使用scheme解决这个问题问题。xcode

步骤:性能

    首先在pch文件中添加ui

#ifdef DEBUG调试

# define  DLog(...) print(__VA_ARGS__)code

#else开发

# define DLog(...)get

#endifit

首先点击xcode导航栏的(形式大写A的图标)targets,选中new scheme弹出alert,将name改成PresentationLayer,此时选中新建的PresentationLayer;io

在点击此处选中Edit scheme,在alert中左边选中run,右边选择info,将Build Configuration值选为Release,点击OK;sso

而后选中target->Build Settings->Apple LLVM7.1-Preprocessing->PreProcessor Macros->Debug双击空白添加DEBUG或者DEBUG=1

当咱们想要出去NS�Assert时,target->Build Settings->Apple LLVM7.1-Preprocessing->PreProcessor Macros->Release双击空白添加NS_BLOCK_ASSERTIONS

相关文章
相关标签/搜索