Re: [Pyobjc-dev] PyObjC 2.0 & Xcode 3.0
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2009-03-31 14:52:47
|
On 31 Mar, 2009, at 9:44, Mike Matz wrote: > Thanks Ronald. Could you recommend anything for understanding the > Cocoa classes. For example, right now I am stuck on implementing a > search field using the NSSearchField class. Is there any literature > out there that would help explain how to implement that class? And > possibly provide examples. I have the O'Reilly Python Cookbook and > that has worked great for me because I can see how the code works. > I was stuck on implementing an NSTableView with an array before and > found a great tutorial to get me through it. I feel like I am > missing something or not looking in the right places for answers. > The tutorial was completely different from Apples documentation. > Would I benefit more by posting to an Apple Cocoa list as well? One great resource to get help is the pythonmac-sig mailinglist. That is a maillist for Python users on OSX and they tend to be a helpful bunch of people. Any Cocoa book should help you get to understand how to use these frameworks. All books I know of assume that you'll program in Objective-C, but it is pretty straightforward to translate from ObjC to Python; the hard part is to understand how to use the frameworks in the first place. Ronald > Thanks, > Mike > > > On Mar 31, 2009, at 9:52 AM, Ronald Oussoren wrote: > >> >> 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 >> > |