On 28.07.2011, at 00:24, Ondřej Čada wrote:
>> You could probably use a trampoline in combination with a category on
>> NSObject to achieve cleaner syntax, e.g.:
>> [[self runtimeSuper] foo];
> I believe it would be solveable; nevertheless, myself, I am yet to see a reasonable code which does [super something] in a trait code. So, in my implementation, I simply documented super as invalid with "undefined results" :)
1) a GUI editor. You want to subclass each UI element (pushbutton, text field, slider etc.) with the same code to handle clicks in "editing" mode differently than in "run" mode. You want to override -drawRect: to draw the selection highlight and resize handles, and you want to override the view's resetCursorRects to change the cursor to an arrow/resize handles instead of whatever the view would set. To get the view to draw under the highlight, you actually need to call through to super first.
2) Adding forwarding of unused key presses to NSTableView and NSOutlineView. You really just want to override a few NSTableView methods, but since you can't make NSOutlineView retroactively subclass from your class, you need to duplicate the code. In those cases you also need to call super.
Both of these uses could be cleanly solved by using traits. Or am I misunderstanding where you're thinking calls to super are uncommon?
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden