Theocacao
Leopard
Design Element
Comment on "Add Methods at Runtime in Objective-C"
by Jon Hess — Oct 26
You could build a class dynamically at runtime, that subclasses some know class. Then add methods to it to override methods from the baseclass, then swtich a sepcific instance of the base class to your new derived class.

This may sound like a hack, but it is a much more appropriate hack than the sledgehammer that was poseAs:. Its also much more appropriate than smashing a method with a category.
Back to "Add Methods at Runtime in Objective-C"
Design Element

Copyright © Scott Stevenson 2004-2015