Re: [Pyobjc-dev] In and out of NSData
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-01-11 22:19:49
|
On Saturday, Jan 11, 2003, at 04:56 Europe/Amsterdam, bb...@ma... wrote: > On Friday, Jan 10, 2003, at 16:28 US/Eastern, Ronald Oussoren wrote: >> I found where this problem originates: inside Cocoa :-(. I can >> probably get a simular crash using pure objective-C code (I've not >> tested this, hence the 'probably'). > > Ugh... > > Maybe we need to create a list of selectors for which the return value > should be followed as 'self' and not the initial target of the method > call. > > This would also address situations like the following: > > - init > { > if (self = [super init]) { > // local initialization > } > > return self; > } That should not be a problem, unless [super init] invalidates the value of self (before the assignment). I agree that we should add a generic mechanism for this. I'm busy added a flag-bit to selectors, the flag can be changed from Python code. This allows us to add Python-code to objc._convenience that correctly sets this flag. I'll check-in this change when I'm done with this. BTW. Shall I set this flag for all instance-methods whose selector starts with 'init'? This is simple enough to do and is probably exactly what's needed. Ronald |