std::ifstream vertFStream( vertfile ); // vertfile's contents is "assets/shaders/ortho2d.vert"if (!vertFStream) { std::cerr << vertfile << " missing!" << std::endl; exit( 1 );}
我已将assets文件夹作为蓝色文件夹添加到XCode项目中,它显示在Targets-> copy Bundle Resources中.
解决方法 试试这个:NSBundle *b = [NSBundle mainBundle];Nsstring *dir = [b resourcePath];NSArray *parts = [NSArray arrayWithObjects: dir,@"assets",@"shaders",@"ortho2d.vert",(voID *)nil];Nsstring *path = [Nsstring pathWithComponents:parts];const char *cpath = [path fileSystemRepresentation];std::string vertfile(cpath);std::ifstream vertFStream(vertfile);总结
以上是内存溢出为你收集整理的iphone – 使用C在iOS应用程序中找不到的文件夹中的文件全部内容,希望文章能够帮你解决iphone – 使用C在iOS应用程序中找不到的文件夹中的文件所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)