title: NSArray out of bounds check
body: <p>noobie question.. What is the best way to check if the index of an NSArray or NSMutableArray exists. I search everywhere to no avail!!</p>
  
  <p>This is what I have tried:</p>
  
  <pre><code>if (sections = [arr objectAtIndex:4])
  {
      /*.....*/
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>sections = [arr objectAtIndex:4]
  if (sections == nil)
  {
      /*.....*/
  }
  </code></pre>
  
  <p>but both throws an "out of bounds" error not allowing me to continue</p>
  
  <p>(do not reply with a try catch because thats not a solution for me)</p>
  
  <p>Thanks in advance</p>