title: Test if my array is nil at a given index?
body: <p>I'm trying to create an <code>NSMutableArray</code> containing the contents of another at a given index. </p>
  
  <p>I'm initializing the new array with <code>initWithArray:</code> if the previous array has anything at the index, otherwise with plain <code>init</code></p>
  
  <p>This code doesn't work but you should be able to get the idea from it:</p>
  
  <pre><code>NSMutableArray *typeCourseCutId;
  if([self.typeCourseCut objectAtIndex:typeCourseIndex] != nil){
      typeCourseCutId = [[NSMutableArray alloc]initWithArray:[self.typeCourseCut objectAtIndex:typeCourseIndex]];
  } else {
      typeCourseCutId = [[NSMutableArray alloc]init];
  }
  </code></pre>
  
  <p>Is there a solution for this kind of test?</p>