All NSObjCMessageLoggingEnabled really calls CoreFoundation to automatically call instrumentObjcMessageSends at startup and shutdown.
The problem is that Apple intentionally hid this feature in the native SDK for iOS, so you can't just name it.
But it still exists in dylib at runtime, so you can always do this:
typedef void functype(BOOL); void *libobjc = dlopen("/usr/lib/libobjc.dylib", RTLD_LAZY); functype *instrumentObjcMessageSends = dlsym(libobjc, "instrumentObjcMessageSends"); if (!instrumentObjcMessageSends) { NSLog(@"Couldn't get instrumentObjcMessageSends"); exit(1); } instrumentObjcMessageSends(YES); NSLog(@"Did it");
I donβt know where, if anywhere, magazines are recorded. I assume you will want to call logObjcMessageSends to register your own ObjCLogProc , as described in the post you linked.
source share