Re: Subclassing From Code?
Re: Subclassing From Code?
- Subject: Re: Subclassing From Code?
- From: Shaun Wexler <email@hidden>
- Date: Sun, 16 Nov 2003 22:15:16 -0800
On Nov 16, 2003, at 5:51 PM, David McGavern wrote:
How can I dynamically make a class a subclass of another class, from
code? For example, if I have an LWSearchField (my own class) that I
want to make into a NSSearchField (if 10.3 is detected). Any help is
greatly appreciated :-).
Most likely that won't be necessary. Have a look at:
http://developer.apple.com/documentation/Cocoa/Conceptual/Foundation/
Concepts/ClassClusters.html
If LWSearchField inherits from NSTextField, and covers the same methods
and method signatures as NSSearchField, your init method can simply
return an instance of NSSearchField if you're on 10.3, or in your
LWSearchField cellClass method, return the NSSearchFieldCell class
instead.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.