Documentation
¶
Overview ¶
Exception-handler demonstrates observing Objective-C exceptions from Go.
An Objective-C exception raised through a Go-initiated message send is always fatal. On 64-bit Apple platforms the runtime unwinds using DWARF tables that Go frames do not carry, so the search for a handler stops at the first Go frame and the process aborts. recover cannot intercept the result. The hooks below therefore observe an exception on its way out -- reading its name, reason and call stack, writing a report -- and cannot resume execution.
Validate before calling instead: check RespondsToSelector, bounds and nil.
This example shows how to register a custom handler and preprocessor.
Click to show internal directories.
Click to hide internal directories.