Re: [Pyobjc-dev] PyObjC 2.0 & Xcode 3.0
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2009-03-31 13:52:38
|
On 31 Mar, 2009, at 8:23, Mike Matz wrote: > I am attempting to write a small program using Python/PyObjC 2.0 and > Xcode 3. I have Python experience, but no Objective C experience. I > have developed Cocoa applications in the past using AppleScript, but I > am finding there is a huge learning curve to using Python and Cocoa. > I have found one or two good tutorials that that have gotten me pretty > far. However, I am now at the point where I am trying to use Apple's > built in documentation of the ObjC/Cocoa classes and having trouble > implementing them in my Python code. I have searched Google high and > low for material relating to PyObjC 2.0 and Xcode 3.0, but have not > found much. Can anyone recommend tutorials, websites, even books, > that might help me get a handle on Cocoa development with Python in > Xcode? The examples and documentation on the PyObjc website should get you going as far as actual code is concerned. Development using Xcode isn't documented very well (or at all) at the moment, mostly because I don't use Xcode a lot myself. For simple applications it you can just add all your Python files to an Xcode project that's started from one of the Python Cocoa templates that ship with Xcode. Don't forget to import all modules that define classes that are used by your NIB files (the "main.py" file seems a great place to do that), otherwise the modules won't be loaded and Cocoa won't see your classes. Things get a little messy when you have dependencies on 3th party libraries, Xcode won't automaticly copy those into your .app bundle and you'll have to add a custom shell-script step to your Xcode project to do that for you. It should be possible to create a tool based on py2app that does this for you, but AFAIK nobody has looked into that yet. Ronald |