C++获取iOS .app路径
2018-11-01 本文已影响0人
十五_ed26
#ifdef __APPLE__
CFBundleRef ref = CFBundleGetMainBundle();
CFURLRef fileURL = CFBundleCopyResourcesDirectoryURL(ref);
CFStringRef filePath = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
constchar*path =CFStringGetCStringPtr(filePath, encodingMethod);
resPath= path;
#endif