PyObjC on Xcode 4
Asked Answered
S

3

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?

Shenashenan answered 30/4, 2011 at 17:39 Comment(4)
SO has had a very similar discussion here.Aboard
I saw that discussion. It does not solve my problem because I want to add python to an already existing project of mine.Shenashenan
Also, what I want is to be able to create Cocoa subclasses. I don't want to simply edit a pyhton file in xCode instead of doing t in IDLE.Shenashenan
Ah, I see. I'll try to find something else.Aboard
T
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.

Telophase answered 2/5, 2011 at 17:42 Comment(2)
Those templates are not working. Even simply opening one of them and trying to build it will fail.Shenashenan
@Jaliborc: well, that's why I said "...might require some mangling." 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.Telophase
V
8

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

Vehement answered 11/6, 2012 at 18:15 Comment(0)
T
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.

Telophase answered 2/5, 2011 at 17:42 Comment(2)
Those templates are not working. Even simply opening one of them and trying to build it will fail.Shenashenan
@Jaliborc: well, that's why I said "...might require some mangling." 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.Telophase
S
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.

Sidoon answered 18/10, 2011 at 23:39 Comment(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.Impasto
PyOjbC is still in active development in 2019, with version 5 released.Kaliope

© 2022 - 2024 — McMap. All rights reserved.