13

Xcode 3 had templates for building Cocoa subclasses in Python. I've recently upgraded to Xcode 4 but I cannot find out how I can use other languages besides the C family (C, C++, Obj-C) in Xcode 4.

Does anyone know?

jscs
  • 63,694
  • 13
  • 151
  • 195
Jaliborc
  • 353
  • 5
  • 16

3 Answers3

8

See here: https://github.com/gregneagle/Xcode4CocoaPythonTemplates

Ferguzz
  • 5,777
  • 7
  • 34
  • 41
3

The Python-Cocoa class templates you're looking for are part of PyObjC, but Apple stopped including them in the install around the end of Leopard (I think), because they got out of sync with Xcode. You can download the latest versions yourself from the PyObjC repository. According to this recent guide I found, they should go in ~/Library/Developer/Xcode/Templates/.

Beware, however: according to Ronald Oussoren, PyObjC's developer, the Interface Builder part of Xcode 4 is not at all compatible with PyObjC. He made a posting to the pythonmac mailing list and another to the pyobjc-dev list suggesting that bugs be filed with Apple, requesting continued Xcode support for the bridge. There's nothing that can be done on either his or your end; Apple has to do this.

You'll have to keep Xcode 3 around to do PyObjC GUI stuff.

jscs
  • 63,694
  • 13
  • 151
  • 195
  • 2
    Those templates are not working. Even simply opening one of them and trying to build it will fail. – Jaliborc May 02 '11 at 21:23
  • @Jaliborc: well, that's why I said "...might require some mangling." [bbum](http://stackoverflow.com/users/25646/bbum) is the maintainer of the templates. You could try posting a question specifically about their status and hope he replies. Or send a message to the [PyObjC mailing list](https://lists.sourceforge.net/lists/listinfo/pyobjc-dev). – jscs May 02 '11 at 21:30
2

I've successfully built a MacRuby GUI app in XCode 4.2 on Lion today following a MacRuby tutorial on Apple's site. MacRuby also includes a template in XCode 4.2. I'm a Python programmer and really hoped to use it, but at this point I've given up on PyObjC. I use Tk in Python for quick little apps and maybe switch to MacRuby, but will likely just switch to Objective-c. Ruby is a pretty nice language though. Maybe MacRuby will interest you.

Mohawke
  • 21
  • 2
  • It's a shame, but PyObjC gets so little mention - as of late - that I'd agree that it's S.O.L. - to the point that being E.O.L.'d is just a matter of time. R.I.P, you snake "under the bridge", LOL. – Alex Gray Nov 19 '11 at 00:19
  • PyOjbC is still in active development in 2019, with version 5 released. – benwiggy Jan 02 '19 at 15:16