title: Is it defined behavior to change an Objective-C object's isa?
body: <p>In Objective-C, you can change an object's dynamic type at runtime by assigning to it's <code>isa</code> member variable:</p>
  
  <pre><code>id object = ...;
  object-&gt;isa = [SomeClass class];
  </code></pre>
  
  <p>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.</p>