Change superclass programatically
On 08/27/2014 12:14 PM, Yuriy Tymchuk wrote:
Any ideas? https://stackoverflow.com/questions/25535202/change-superclass-programatical...
It looks like sending #superclass: to the class would work. Regards, -Martin
On 08/27/2014 12:23 PM, Martin McClure wrote:
On 08/27/2014 12:14 PM, Yuriy Tymchuk wrote:
Any ideas? https://stackoverflow.com/questions/25535202/change-superclass-programatical...
It looks like sending #superclass: to the class would work.
Yes, I verified this works, though I didn't try any tricky cases where the old and new superclasses have different numbers of instvars, or instvars with different names. I'd expect those cases to require more sophisticated solutions. Regards, -Martin
With refactoring I think it is also possible, however it requires more programming and understanding of the refactoring classes 2014-08-27 21:28 GMT+02:00 Martin McClure <martin@hand2mouse.com>:
On 08/27/2014 12:23 PM, Martin McClure wrote:
On 08/27/2014 12:14 PM, Yuriy Tymchuk wrote:
Any ideas? https://stackoverflow.com/questions/25535202/change- superclass-programatically
It looks like sending #superclass: to the class would work.
Yes, I verified this works, though I didn't try any tricky cases where the old and new superclasses have different numbers of instvars, or instvars with different names. I'd expect those cases to require more sophisticated solutions.
Regards,
-Martin
participants (3)
-
Martin McClure -
Sebastian Tleye -
Yuriy Tymchuk