What's the point of NSAssert, actually?

后端 未结 10 2037
一个人的身影
一个人的身影 2020-12-04 05:43

I have to ask this, because: The only thing I recognize is, that if the assertion fails, the app crashes. Is that the reason why to use NSAssert? Or what else is the benefit

10条回答
  •  伪装坚强ぢ
    2020-12-04 06:13

    It's worthwhile to point out that aside from run time checking, assert programming is a important facility used when you design your code by contract.

    More info on the subject of assertion and design by contract can be found below:

    Assertion (software development)

    Design by contract

    Programming With Assertions

    Design by Contract, by Example [Paperback]

提交回复
热议问题