Using ctypes, I am getting a handle for objc_getClass method, and then I am trying to locate NSString but it FAILS!! At the same time, other classes such as NSSet/NSMutableArray and so on just work great!
import ctypes
from ctypes import cdll
c = cdll.LoadLibrary(None)
objc_getClass = c.objc_getClass
>>> c.objc_getClass(b'NSSet')
-110110920
>>> c.objc_getClass(b'NSString')
0
That's probably because the Foundation framework is not loaded.
Try adding this before trying to resolve classes:
cdll.LoadLibrary('/System/Library/Frameworks/Foundation.framework/Foundation')