How I like to code

Monthly Archives: February 2015

Xcode dylib constructor destructor

I meant to post this link a while ago, but here it is anyway: TP40002013-SW17 So, in a dylib, you can have code execute when the dylib is loaded and execute code when the dylib is being unloaded: ?View Code C__attribute__((constructor)) static void initializer1() { printf("[%s] [%s]\n", __FILE__, __FUNCTION__); }   __attribute__((constructor)) static void initializer2() […]