From: Ronald Oussoren <ronaldoussoren@ma...> - 2004-05-05 18:13:11
On 5-mei-04, at 19:55, Bob Ippolito wrote:
> Update of /cvsroot/pyobjc/pyobjc/Lib/objc/test
> In directory
> Modified Files:
> Log Message:
> Contrive a bizarre really hard to debug situation that works with the
> initializer pattern but not the old.
> p.s. Ronald, turn on -O0 before even trying to track it down .. ;)
Thanks, that's really helpful. The initializer flag has another side
effect that I forgot about, the bridge "knows" that they return self,
and that probably causes problems here (and even if it wouldn't this is
obviously incorrect for methods that return an object but are not an
initializer..., e.g. -(id)initialValue;.
We need to recognize that an object is initialized, because of class
clusters (e.g. release-ing the result of NSArray.alloc() is not good
for your health).
I'm going to look at your patch, it probably saner than assuming that
all methods whose name starts with init followed by an uppercase letter
(or whose name is init) are initializers.
> def setBar_(self, value):
> + self.initiateDestructionSequence()
# to_objc(self) == nil at this point
> self._kvo_bar = value
> setBar_ = objc.accessor(setBar_)
I can't wait until we can write this as 'def setBar_(self, value)
X|support bv http://www.xsupport.nl/
T: +31 610271479 F: +31 204416173
On May 5, 2004, at 11:13 AM, Ronald Oussoren wrote:
> I'm going to look at your patch, it probably saner than assuming that
> all methods whose name starts with init followed by an uppercase
> letter (or whose name is init) are initializers.