Re: [Pyobjc-dev] Wrapping objective-c classes using pyobjc
Brought to you by:
ronaldoussoren
|
From: Yi Q. <yq...@gm...> - 2009-02-22 07:47:19
|
Amazing, thanks. I had no idea that PyObjC's Foundation module would do that for me. Is this documented somewhere On Sat, Feb 21, 2009 at 11:10 PM, Michael VanLandingham <m.v...@gm... > wrote: > If you're using the PyObjC templates from Xcode, and if your objc code and > python code are in the same program/project, you can get to your ObjC > class(es) simply by importing Foundation in the python module -- your class > and methods will be found at runtime via PyObjC's introspection mechanism. > Easy! > > If you're not already using one of the Xcode PyObjC templates for your > project, you could: > a) move your existing python code into a new project based on those > templates, > b) Compile an app containing your classes that will use the Python API to > load and run your python code-- which is pretty much what the 'main.m' file > does in the Xcode PyObjc templates, or > c) compile your classes into a plugin/bundle and use the > objc.loadBundle() method to load that code. > (there are other solutions, but those are the ones that come to mind right > off) > > HTH, > -mv > > On Sat, Feb 21, 2009 at 3:40 PM, Yi Qiang <yq...@gm...> wrote: > >> Hi, >> How do I wrap a single objective-c class so that I can access it from >> python? I looked at the objc documentation and it has information on how to >> extract & wrap classes for a framework, using objc.loadBundle(). However, I >> just have a single class (.m/.h) that I want to be able to access. >> >> Cheers, >> Yi >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> >> > |