From: Ronald Oussoren <ronaldoussoren@ma...> - 2006-11-16 16:18:09
On Thursday, November 16, 2006, at 04:12PM, "Timothy Reaves" <treaves@...> wrote:
> When I am creating python classes in my Objective-C code, do I still
>use the same alloc/init/release paradigm?
That depends on what you're trying to do. If you create instances of a subclass of NSObject you should use the usual alloc/init/release paradigm. However note that you cannot have static references to a class that is defined in Python (that is you cannot do [[MyPythonClass alloc] init]). You'll have to lookup the class using objc_lookUpClass to get a reference to the class.
If you want to use pure python instances (such as python lists or user defined python classes) you use the usual python paradigm, and you have to use the normal Python extension API's to create instances.