【发布时间】:2013-08-28 02:19:50
【问题描述】:
我制作了一个 ruby 脚本,它可以从其他格式的数据生成 Plist(此脚本位于 xcode 的项目文件夹中)。
我已经创建了一个自定义运行脚本构建阶段来调用我的脚本:
echo "Running xls Plister"
cd ${PROJECT_DIR}/plistr
ruby plistr.rb
scriptExitStatus=$?
echo "DONE with script: (exitStatus=${scriptExitStatus})"
exit "${scriptExitStatus}"
此脚本输出以下文件夹${PROJECT_DIR}/plistr/output/data.plist中的plist
我不知道如何将它复制到 Bundle 资源中,以便我可以通过以下方式访问它:
[[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"];
编辑:我的实际解决方法是将脚本作为第一个构建步骤运行,并在“复制捆绑资源”中手动添加对生成的 plist 的引用
【问题讨论】:
标签: xcode