xcode在为iphone构建时的资源组和文件夹引用
其他废话的就不一一翻译了,主要给步骤
1,添加一个文件夹(名字随便起只要不是resources就行)到你的项目里(可以放在resources文件夹下面也可以同目录),然后添加这个文件夹的引用(注意了时 folder reference)
看文件夹的颜色是蓝色的。
2.我做的方法和原文有点不一样,但是目的和结果都时一样的,
首先左击targets下面的一个目标,然后点击build phases 再点击右下角的add build phases
弹出 的三个选项,选择add run script ,然后 shell: /bin/tcsh
script:
touch -cm ${SRCROOT}/../../GameResources
这里的GameResources 是你所建立的文件夹
到此为止,该做的都做了,你再试一试移动你所建立的文件夹的资源是不是有点不一样哈~~
注意:
Before this, you probably used [[NSBundle mainBundle] resourcePath] or pathForResource:. These won’t work anymore, as all your resources are now inside ‘GameResources’ or whatever. [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@”GameResources”] or similar will need to be used instead. 就是这个方法不能再像以前那样用了。
我写的比较凌乱,如果想看得仔细一点就去原文看吧。
http://majicjungle.com/blog/123/
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。