Xcode 3.2已经删除了脚本语言(Ruby,Python等)的默认模板。如何在Xcode 3.2中找到这些模板?我需要添加任何其他的Xcode来支持使用和“构建”PyObjC程序?
另外,是否有任何文档和/或资源可以帮助我进入PyObjC(和Cocoa),考虑到我已经是一个Python的人了?
苹果现在鼓励人们直接从PyObjC项目获取模板。有一个很好的线索解释存档在
Cocoabuilder,从bbum的以下建议:
You’ll need to download and install the templates from the PyObjC
repository or web site.
The templates were pulled from the release because the template
development moves at a different pace & schedule than the Xcode
releases. Too often,the templates have been out of date by the time
the discs were pressed.
PyObjC website拥有下载的模板,以及伟大的文档/教程来启动和删除。
编辑:更具体一点,这里是为了让PyObjC在雪豹中工作所做的工作:
>使用Finder,我去了Go>连接到服务器…并作为客人连接到http://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-xcode/。
>然后在我的本地系统上,在?Library / Application Support / Developer / Shared / Xcode /中创建了一个名为Xcode的文件夹。 (你可能已经有这个文件夹,但是我还没有为自己定制任何东西)。
>我将文件模板文件夹从红豆服务器复制到新的Xcode文件夹中。
>将项目模板文件夹复制到其他位置,例如桌面。
>使用终端,导航到我的桌面上的临时项目模板文件夹,并运行此命令“构建”模板:
$ cd ~/Desktop/Project Templates/
$ ./project-tool.py -k -v –template ~/Desktop/Project Templates/Cocoa-Python Application/CocoaApp.xcodeproj/TemplateInfo.plist Cocoa-Python Application ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Cocoa-Python Application
>对其他模板重复:
$./project-tool.py -k -v –template ~/Desktop/Project Templates/Cocoa-Python Document-based Application/CocoaDocApp.xcodeproj/TemplateInfo.plist Cocoa-Python Document-based Application/ ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Cocoa-Python Document-based Application
$ ./project-tool.py -k -v –template ~/Desktop/Project Templates/Cocoa-Python Core Data Application/CocoaApp.xcodeproj/TemplateInfo.plist Cocoa-Python Core Data Application/ ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Cocoa-Python Core Data Application
$ ./project-tool.py -k -v –template ~/Desktop/Project Templates/Cocoa-Python Core Data Document-based Application/CocoaDocApp.xcodeproj/TemplateInfo.plist Cocoa-Python Core Data Document-based Application/ ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Cocoa-Python Core Data Document-based Application
我推出了Xcode。模板现在位于新建项目…和新建文件…窗口的“用户模板”部分下。
默认项目内置的框(不需要从PyObjC项目或py2app安装其他任何东西)。我用一个按钮和一个动作拼凑了一个愚蠢的程序,它的工作精美,包括与Interface Builder的集成(我能够控制拖动以连接动作和插座)。
我最近也在一个博客上偶然发现了一个series of “Getting Started” tutorials,对于初学者来说似乎是非常有用的。作者似乎已经付出了大量的精力投入到“用PyObjC在Python中构建Cocoa GUI”系列(目前在6个部分)。