问题描述
XCode:运行>显示>断点
XCode:Run>Show>Breakpoints
我添加了必须的 [NSExceptionRaise]
和 objc_exception_throw
,但是当我关闭Breakpoints窗口,然后返回XCode时,会添加第三个断点: - [NSExceptionRaise]
。这是否意味着 [NSExceptionRaise]
错误,我应该删除它吗?如果是这样,它们在功能上有什么不同?
I've added the obligatory [NSExceptionRaise]
and objc_exception_throw
yet when I close the Breakpoints window and then return XCode adds a third breakpoint: -[NSExceptionRaise]
. Does this mean [NSExceptionRaise]
is wrong and I should delete it? Or are they both helpful? If so in what way are they functionally different?
推荐答案
正确的断点是:
-[NSException raise]
您正在指示调试器打破 - raise方法的NSException类。 [NSExceptionRaise]是(意味着没有不尊重)废话。 : - )
You're instructing the debugger to break on the -raise method of the NSException class. "[NSExceptionRaise]" is (meaning no disrespect) nonsense. :-)
据我所知,你不需要两者。 objc_exception_throw是新的方式,而 - [NSException raise]是旧的方式。如果您在Leopard或之后,我会相信,只有objc_exception_throw会被调用。 10.4或之前的会调用 - [NSException raise]。
You don't need both, as far as I know. objc_exception_throw is the "new" way, whereas -[NSException raise] is the "old" way. I believe if you're on Leopard or later, only objc_exception_throw will be called. 10.4 or prior will call -[NSException raise].
这篇关于XCode断点[NSExceptionRaise] vs - [NSExceptionRaise]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!