Xcode Breakpoint [NSExceptionRaise] vs. - [NSExceptionRaise]

Xcode: Run> Show> Breakpoints

I added the required [NSExceptionRaise] and objc_exception_throw when I close the breakpoint window, and then return Xcode adds a third -[NSExceptionRaise] breakpoint: -[NSExceptionRaise] . Does this mean that [NSExceptionRaise] is wrong, and should I delete it? Or are they both useful? If so, how do they functionally differ?

alt text

+4
source share
3 answers

The correct breakpoint:

 -[NSException raise] 

You instruct the debugger to break the -raise method of the NSException class. "[NSExceptionRaise]" (means no disrespect) bullshit .:-)

You do not need both, as far as I know. objc_exception_throw is the "new" way, while [NSException raise] is the "old" way. I believe that if you are on Leopard or later, only objc_exception_throw will be called. 10.4 or earlier will call - [NSException raise].

+3
source

The newly added breakpoint is -[NSException raise] , which differs from [NSExceptionRaise] in that the latter is an object method ( NSException is a class, raise is a message). I don't know what the latter is, and I suspect that Xcode is trying to be reasonable about what you entered v. What does he think you mean.

0
source

You must specify a method with a plus or minus sign because the debugger uses headers to define and define the character. Different methods may have the same name, but methods preceded by "+" are methods of the class, and those preceded by "-" are instance methods. Without a plus or minus, the debugger has no idea which method you wanted.

0
source

All Articles