PyObjC development with Xcode 3.2

后端 未结 3 2133
孤城傲影
孤城傲影 2021-01-30 14:59

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

相关标签:
3条回答
  • 2021-01-30 15:42

    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:

    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.

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


    Edit: 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.

    • 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).

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

    • 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 ~/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

    • Repeat for the other templates:

    $./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

    • I launched Xcode. The templates are now located under the "User Templates" section of the New Project... and New File... windows.

    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).

    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).

    0 讨论(0)
  • 2021-01-30 15:51

    Xcode has been changed, this is the way you do it:

    1. Download the templates from https://github.com/gregneagle/Xcode4CocoaPythonTemplates

    2. Copy the two folders, File Templates and Project Templates to ~/Library/Developer/Xcode/Templates. If you don't have this folder already create it.

    3. When you open Xcode and create a new project, you will see a new section called "Cocoa-Python" with the 4 templates.

    0 讨论(0)
  • 2021-01-30 15:54

    Check out this blog posting... fixed it perfectly for me: http://ioanna.me/2009/09/installing-pyobjc-xcode-templates-in-snow-leopard/

    0 讨论(0)
提交回复
热议问题