title: What's the difference between dot syntax and square bracket syntax?
body: <p>I am going through some walkthroughs fpr Objective-C and I got to many places where I raised my eyebrows. I would love to get them down.</p>
  
  <ol>
  <li><p>Is there a fundamental difference in message sending and method calling? Objective-C lets me do both: <code>object.message</code> yields the same result as <code>[object message]</code>. I think maybe nested messages cannot be created using the dot operator strategy?</p></li>
  <li><p>I created an <code>NSArray</code> object, now I am about to print results for this using an <code>NSEnumerator</code>:</p>
  
  <p><code>id myObject = [object objectEnumerator];</code></p>
  
  <p>in a while loop iterating and printing results. The <em>type</em> of <code>myObject</code> is <code>id</code>, which means it's resolved at runtime and not compile time. I know very clearly what kind of objects are stored in my <code>NSArray</code>—they are <code>NSString</code>s—so by changing the type of <code>myObject</code> to
  <code>NSString * myObject</code>, it works just fine. However, I experimented and found out that <code>myObject</code> can be of any type, be it <code>NSString</code> or <code>NSArray</code> or <code>NSEnumerator</code>, and any of these work just fine, perfectly iterating the <code>NSArray</code> object and yielding the same results.
  What's up with that?</p></li>
  </ol>