title: NSArray objectAtIndex: shorthand
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9693647/is-there-some-literal-dictionary-or-array-syntax-in-objective-c">Is there some literal dictionary or array syntax in Objective-C?</a>  </p>
  </blockquote>
  
  
  
  <p>I have recently noticed that something strange seems to work in objective-c.</p>
  
  <p>When I have an array,</p>
  
  <pre><code>NSArray *myArray = @[@"1", @"b", @"3", @"d"];
  </code></pre>
  
  <p>I can normally access the second element by,</p>
  
  <pre><code>NSString *element = [myArray objectAtIndex:1]; // second element 
  </code></pre>
  
  <p>however I seem to now also be able to access it via.</p>
  
  <pre><code>NSString *element = myArray[1];
  </code></pre>
  
  <p>Does anyone know if this is now a defined behaviour and therefore safe to use, or should I avoid it? Thanks to anyone who can help!!</p>