Re: [Pyobjc-dev] Accessing python classes in obj-c
Brought to you by:
ronaldoussoren
From: Jiva D. <ji...@de...> - 2003-12-08 22:19:37
|
Got it. Thanks for the clarification. On Dec 8, 2003, at 2:09 PM, b.bum wrote: > Compile time is a bit harder. In particular, you can't refer to any > class implemented in python directly because there won't be a real > class object to link against as the source is compiled. To solve > this problem, I have used an abstract superclass implemented in > Objective-C (a class that simply declares all the methods where the > implementation is stubbed out) and a concrete subclass implemented in > Python. To the abstract superclass-- the objc class-- I have added a > factory method that instantiates and returns the concrete subclass. > > This is effectively exactly how class clusters work. > > Finally, you have to trigger the execution of a bit of python code > from somewhere in your code for all of this to work. The easiest > solution would be to simply grab the main() function that > uses/initializes the embedded interpreter and use that within your > app. Then your main.py could import whatever classes you need to > start the application and you could go from there. > > b.bum -- Jiva DeVoe jiva at devoesquared.com http://www.devoesquared.com |