macOS logo

Нашел у себя в черновиках. Не уверен, что я этот код где-либо использовал, но для затравки сойдёт.
Object-C:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
const char* path = [[[NSBundle mainBundle] bundlePath] UTF8String];
const char* path = [[[NSBundle mainBundle] bundlePath] UTF8String];
const char* path = [[[NSBundle mainBundle] bundlePath] UTF8String];

Или так:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
CFBundleRef bundle = CFBundleGetMainBundle();
CFURLRef = CFBundleCopyResourcesDirectoryURL(bundle);
CFStringRef = CFURLCopyFileSystemPath(res, kCFURLPOSIXPathStyle);
char path[8192];
CFStringGetFileSystemRepresentation(resStr, path, sizeof(path));
CFBundleRef bundle = CFBundleGetMainBundle(); CFURLRef = CFBundleCopyResourcesDirectoryURL(bundle); CFStringRef = CFURLCopyFileSystemPath(res, kCFURLPOSIXPathStyle); char path[8192]; CFStringGetFileSystemRepresentation(resStr, path, sizeof(path));
CFBundleRef bundle = CFBundleGetMainBundle();
CFURLRef = CFBundleCopyResourcesDirectoryURL(bundle);
CFStringRef = CFURLCopyFileSystemPath(res, kCFURLPOSIXPathStyle);

char path[8192];
CFStringGetFileSystemRepresentation(resStr, path, sizeof(path));