Re: [Pyobjc-dev] Categories (was: Subclassing NSTextField)
Brought to you by:
ronaldoussoren
From: Peter M. <zig...@po...> - 2002-12-18 16:19:04
|
Yeah, I thought it looked a bit strange. I thought I'd send it to you anyway just in case. Peter On Thursday, December 19, 2002, at 02:51 AM, bb...@ma... wrote: > On Wednesday, Dec 18, 2002, at 10:44 US/Eastern, Peter Montagner wrote: >> I don't know if this is what you want but it may help: >> >> http://www.cocoadev.com/index.pl?MethodSwizzling > > Personally, I'm intimately familiar with method swizzling-- having > used it many times to wreak havoc upon an application. :-) > > His example isn't very good -- he could have used Posing to achieve > the same thing. > > The code is fairly clean, but has some issues. There is no need to > swizzle the types-- the types should not change without serious risk > of crashing. > > There is no need to actually declare a method. His alt method could > easily have been declared as a C function: > > void alt_method(T *self, SEL _cmd) { > ... > } > > This allows one to define the method without knowing the class > declaration in the first place-- which is where swizzling is most > useful (i.e. editing classes for which you do not have a declaration > that can be used to compile against). > > b.bum > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Order your Holiday Geek Presents > Now! > Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated > Soap, > MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty. > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |