使用 Xcode 3.2 进行 PyObjC 开发 [英] PyObjC development with Xcode 3.2

查看:22
本文介绍了使用 Xcode 3.2 进行 PyObjC 开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 3.2 删除了脚本语言(Ruby、Python 等)的默认模板.如何找到这些模板以在 Xcode 3.2 中使用?我是否需要向 Xcode 添加任何其他内容以支持使用和构建"PyObjC 程序?

Xcode 3.2 has removed the default templates for the scripting languages (Ruby, Python etc). How do I find these templates to use in Xcode 3.2? Would I need to add anything else to Xcode to support working with and 'building' PyObjC programs?

此外,考虑到我已经是一个 Python 人,是否有任何文档和/或资源可以帮助我进入 PyObjC(和 Cocoa)?

Additionally, is there any documentation and/or resources that would help me get into PyObjC (and Cocoa), taking into account I am already a Python guy?

推荐答案

Apple 现在鼓励人们直接从 PyObjC 项目中获取模板.在 Cocoabuilder 上存档了一个很好的解释线索,与以下来自 bbum 的建议:

Apple now encourages people to get the templates directly from the PyObjC project. There's a nice thread of explanation archived on Cocoabuilder, with the following advice from bbum:

您需要从 PyObjC 下载并安装模板
存储库或网站.

You'll need to download and install the templates from the PyObjC
repository or web site.

模板已从发布中提取,因为模板
发展以不同的速度发展排程比Xcode
发布.很多时候,模板已经过时了
光盘被压住了.

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 网站 既有模板可供下载,也有很好的文档/教程可供使用.

The PyObjC website has both the templates for download, and great documentation/tutorials to get up and going.

更具体一点,这是我为让 PyObjC 在 Snow Leopard 中工作所做的工作:

Being a bit more specific, here's what I have done to get PyObjC working in Snow Leopard:

  • Using the Finder, I went to Go > Connect to Server... and connected to http://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-xcode/ as a guest.

然后我在本地系统上的 ~Library/Application Support/Developer/Shared/Xcode/ 创建了一个名为 Xcode 的文件夹.(你可能已经有了这个文件夹,但我还没有为自己定制任何东西).

I then made a folder called Xcode on my local system at ~Library/Application Support/Developer/Shared/Xcode/. (You may already have this folder, but I hadn't customized anything for myself yet).

我将 File Templates 文件夹从红豆服务器复制到我的新 Xcode 文件夹中.

I copied the File Templates folder from the red-bean server into my new Xcode folder.

Project Templates 文件夹复制到其他地方,例如桌面.

Copied the Project Templates folder to some other place, for example, the Desktop.

使用终端,导航到我桌面上的临时项目模板文件夹并运行此命令以构建"模板.:

Using the Terminal, navigated to the temporary Project Templates folder on my Desktop and ran this command to "build" the template.:

$ cd ~/桌面/项目\模板/

$ 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\ 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\ 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\ 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

    $ ./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.模板现在位于 New Project...New File... 窗口的用户模板"部分下.
      • I launched Xcode. The templates are now located under the "User Templates" section of the New Project... and New File... windows.
      • 开箱即用的默认项目(无需从 PyObjC 项目或 py2app 安装任何其他内容).我用一个按钮和一个动作拼凑了一个愚蠢的程序,它工作得很好,包括与 Interface Builder 的集成(我能够控制拖动来连接动作和插座).

        The default project built out of the box (no need to install anything else from the PyObjC project, or py2app). I cobbled up a silly program with one button and an action, and it worked beautifully, including integration with Interface Builder (I was able to control-drag to wire up actions and outlets).

        我最近还在一个博客上偶然发现了系列入门"教程对初学者来说似乎很有用.作者似乎在使用 PyObjC 在 Python 中构建 Cocoa GUI"系列(目前分为 6 部分)投入了大量精力.

        I also recently stumbled across a series of "Getting Started" tutorials on a blog that seemed quite useful for beginners. The author appears to have put a lot of effort into the "Building Cocoa GUIs in Python with PyObjC" series (currently in 6 parts).

        这篇关于使用 Xcode 3.2 进行 PyObjC 开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆