mirror of
https://github.com/NohamR/knowledge-kit.git
synced 2026-05-26 13:41:32 +00:00
feat: 初始化
This commit is contained in:
11
第一部分 iOS/1.45.md
Normal file
11
第一部分 iOS/1.45.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# 调试小技巧
|
||||
|
||||
1. 在日常开发中我们经常会封装某个功能模块然后暴露某个方法给外部。但是很多时候调用我们封装功能的人可能会不按照约定的方法传递参数。所以我们会使用断言。但是在线上的时候如果使用了断言,那么程序肯定会 **Crash** ,Xcode 提供了一个小功能可以解决这个问题。
|
||||
|
||||
|
||||
|
||||
NS_BLOCK_ASSERTIONS: 表明在 Release 状态下过滤 NSAssert,只需要这一个条件就可以过滤掉 NSAssert。
|
||||
|
||||
方法:在 “Build Settings” 下搜索 **Preprocessor Macros** ,然后在 Release 下面添加 NS_BLOCK_ASSERTIONS
|
||||
|
||||

|
||||
Reference in New Issue
Block a user