On Thursday, Jan 9, 2003, at 19:53 Europe/Amsterdam, Mirko Viviani
wrote:
> Ciao!
>
> I've implemented objc_addClass() and fixed some things but now there
> is no
> way to call an objc method from a subclass:
>
> [mirko@rey] /usr/home/mirko/src/gnustep/pyobjc> python
> Examples/subclassing-objective-c.py
> <native-selector alloc of <objective-c class Demo at 0x8105780>>
> ->
> Traceback (most recent call last):
> File "Examples/subclassing-objective-c.py", line 31, in ?
> print "->", obj.retainCount();
> AttributeError: 'NoneType' object has no attribute 'retainCount'
>
>
> It seems that is not able to allocate a Demo object... how should I
> check ?
>
'obj' is None, which means Demo.alloc returned a NULL pointer on the
Objective-C side. Demo.alloc is implemented using 'class_method_alloc'
in Modules/objc/class-builder.m, you could add print-statements there
(or somehow add a breakpoint).
Ronald
|