How to call a function exist in libobjc.A.dylib?
<p>I'm studying how KVC works and I set a symbolic breakpoint <code>_class_getVariable</code> which function would be called when sending <code>setValue:forKey:</code> message to object. </p>

<p>So I wrote this:</p>

<p><code>extern Ivar _class_getVariable(Class cls, const char *name, Class *memberOf);</code></p>

<p>and add a flag <code>-Wl,-undefined,dynamic_lookup</code> into <code>Other Linker Flags</code> in building setting to specify this undefined symbol would be look up dynamically. But I still get error from dyld when I call this function:</p>

<pre><code>dyld: lazy symbol binding failed: Symbol not found: __class_getVariable
Referenced from: /Users/Stan/Library/Developer/Xcode/DerivedData/Obj-C-aiaspdiyxsvqblfjkvreemnpekov/Build/Products/Debug/Obj-C
Expected in: flat namespace

dyld: Symbol not found: __class_getVariable
Referenced from: /Users/Stan/Library/Developer/Xcode/DerivedData/Obj-C-aiaspdiyxsvqblfjkvreemnpekov/Build/Products/Debug/Obj-C
Expected in: flat namespace

Program ended with exit code: 9
</code></pre>

<p>I had checked objc-rumtime's sources code, the function do exist in there. Is there any way to call it?</p>

<p><strong>Update</strong></p>

<p>I have found a function <code>class_getInstanceVariable</code> in runtime.h as a replacement to fetch ivar with name. But I'm still curious about how to call <code>_class_getVariable</code>.</p>

<p>Thanks in advance :)</p>