美文网首页
C++获取iOS .app路径

C++获取iOS .app路径

作者: 十五_ed26 | 来源:发表于2018-11-01 17:41 被阅读0次

#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

相关文章

网友评论

      本文标题:C++获取iOS .app路径

      本文链接:https://www.haomeiwen.com/subject/thnxxqtx.html