Created
April 23, 2009 18:23
-
-
Save prophile/100659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <objc/objc.h> | |
#import <dlfcn.h> | |
const char *class_getImageName(Class cls) | |
{ | |
int ok; | |
Dl_info info; | |
if (!cls) return NULL; | |
ok = dladdr(cls, &info); | |
if (ok) return info.dli_fname; | |
else return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment