How can I find the path to a file in an application bundle (NSBundle) using C?

后端 未结 2 1976
予麋鹿
予麋鹿 2021-01-05 06:44

Is there a C API for finding the path to a file in an application bundle?

I know that this can be done in Objective-C with the following syntax.

NSS         


        
2条回答
  •  执笔经年
    2021-01-05 06:54

    you can get the main bundle via:

    CFBundleRef mainBundle = CFBundleGetMainBundle();
    

    full details here:

    http://developer.apple.com/library/mac/#documentation/CoreFOundation/Conceptual/CFBundles/AccessingaBundlesContents/AccessingaBundlesContents.html

提交回复
热议问题