In Objective-C, you can change an object's dynamic type at runtime by assigning to it's isa
member variable:
id object = ...;
object->isa = [SomeClass class];
Is this undefined behavior? I'm currently doing this as a kludge for something else, and it appears to be working, but I feel so dirty doing it this way. The new class I'm setting doesn't add any member variables, it just overrides one method and adds a new one, so the class size is the same. I feel like if I changed the object size, much badness would result.