What are assertions or NSAssert good for in practice?

后端 未结 4 1199
迷失自我
迷失自我 2021-01-30 15:17

I wonder if it\'s a good habit to use NSAssert all over the place? What would be the benefit of doing that? In which situations is it a good idea to use it?

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 15:42

    I highly recommend this article

    http://www.mikeash.com/pyblog/friday-qa-2013-05-03-proper-use-of-asserts.html

    And as the article states it is often good to use a assert-mechanism which is not NSAssert. For example:

    https://github.com/hfossli/AGAssert

提交回复
热议问题