I get the following error for the code below: "A C function pointer cannot be formed from a local function that captures context."
Does anyone propose a creative solution to populate x
in this example? I'm stumped. The underlying types for _header
and _int
respectively are UnsafePointer<mach_header>?
and Int
import MachO
class Example {
func test() {
var x: [Int] = []
_dyld_register_func_for_add_image { (_header, _int) in
x.append(_int)
}
}
}