title: iOS / Objective-C - struct objc_class * and struct objc_object *
body: <p>My understanding is that <em>objects</em> and <em>classes</em> in <strong>Objective-C</strong> are just <em>structs</em>. </p>
  
  <p>Respectively they are just: </p>
  
  <pre><code>struct objc_class *
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>struct objc_object *
  </code></pre>
  
  <p><em><strong>Question #1:</em></strong></p>
  
  <pre><code>objc_msgSend(id self, SEL _cmd);
  </code></pre>
  
  <p><code>id</code> as far as I know is of type <code>struct objc_object *</code></p>
  
  <p>But when we call a class method, a class, which is of type <code>struct objc_class *</code>,</p>
  
  <p>I would expect it to cause problem or shout out some kind of warning such as „Hey, wrong type here, my friend“. </p>
  
  <p>But there isn’t.</p>
  
  <ul>
  <li>Why? </li>
  </ul>
  
  <p>This only serves to fulfill my curiosity, because even without fully understanding this, it doesn’t seem to cause me any trouble (so far). But I would like to dig deep and learn the fundamentals / „peculiarities".</p>
  
  <p><em><strong>Question #2:</em></strong></p>
  
  <p>Since there is no warning according to my experience (relates to <strong><em>Question #1</em></strong>), hence my not-so-sure assumption that they <em>could perhaps</em> be used interchangeably.</p>
  
  <p>Can <code>struct objc_class *</code> and <code>struct objc_object *</code> <em>really</em> be used <strong>interchangeably</strong>?</p>
  
  <p>If yes: </p>
  
  <ul>
  <li><p>Can you show me a scenario and a sample when / how / why we would need to use these interchangeably?</p></li>
  <li><p>What would be the <strong>benefit</strong> (if any), <strong>disadvantages</strong> (if any) and „<strong>gotchas</strong>“ (things to watch out for; if any) doing so?</p></li>
  </ul>