Why does NSAssert break in main instead of in the code that call the assertion

后端 未结 2 591
隐瞒了意图╮
隐瞒了意图╮ 2020-12-21 13:13

I set this NSAssert

NSAssert(isStillLoadingArgument== [[self class] stillLoading],@\"Hmm.... we think isStill Loading is false or true and yet stillLoading i         


        
相关标签:
2条回答
  • 2020-12-21 13:56

    You need to add a Breakpoint to your project for all exceptions.

    1) Click on breakpoint navigator

    Breakpoint

    2) Add an exception breakpoint

    Exception

    3) Make sure you set it to break on all exceptions

    All

    Now XCode will break to the actual assert rather than main. Hope this helps!

    0 讨论(0)
  • 2020-12-21 14:07

    Configure the debugger to break on exceptions.

    When an assertion fails, it raises an exception. If nothing catches the exception, it terminates the program after unwinding the stack, leaving it at main().

    0 讨论(0)
提交回复
热议问题