mok*_*oka 5 c++ resources cocoa
我知道如何从cocoa的Resources文件夹中获取特定文件,即:
NSBundle* myBundle = [NSBundle mainBundle];
NSString* myImage = [myBundle pathForResource:@"Seagull" ofType:@"jpg"];
Run Code Online (Sandbox Code Playgroud)
无论如何,我想有一个简单的函数,它给我一个Resources文件夹的路径,所以我可以像这样在c ++中使用它.
String getResourcePath()
{
return the correct path here
}
std::ofstream theFile;
theFile.open(getResourcePath()+"test.txt");
Run Code Online (Sandbox Code Playgroud)
我想我可以手动将主要包名称与内容/资源结合起来,无论如何我想知道是否有更强大的解决方案!
谢谢!
归档时间: |
|
查看次数: |
4130 次 |
最近记录: |