Re: [Pyobjc-dev] In and out of NSData
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-01-11 16:37:02
|
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; } I would think we could get away with a simple NSMapTable() to do the hashing of the SELs that need the kind of test as indicated above. NSMap*() makes it fast and can use the SEL type directly as the hash. The assumption is that any of the methods of a given selector will all behave the same -- as we are really only dealing with -init* selectors [that I can think of], this would seem to be safe assumption. I'm not sure what other implications this might have. If we can find a generalized solution, it will mitigate maintenance issues down the road. b.bum |