title: 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
body: <p>I have an array with the names of the images in the form of strings, I want to transform it into an array of images and I getting this error, what I did wrong?</p>
  
  <pre><code> 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>NSString * immagini = self.chinaTable.images; //unique string
  
  NSArray * arrayImages = [immagini componentsSeparatedByString:@";"]; 
  NSLog(@"The images: %@", arrayImages);// here are strings
  
  /*The images: (
  "ArchUrb_PortaGenova1.jpg",
  "ArchUrb_PortaGenova2.jpg",
  "ArchUrb_PortaGenova3.jpg",
  "ArchUrb_PortaGenova4.jpg"
  )*/
  
  NSMutableArray * mutableImages =[[NSMutableArray alloc]initWithCapacity:20];
  
  for (id obj in arrayImages){
  
  /*The images: (
  "ArchUrb_PortaGenova1.jpg",
  "ArchUrb_PortaGenova2.jpg",
  "ArchUrb_PortaGenova3.jpg",
  "ArchUrb_PortaGenova4.jpg"
  )*/
  
  
   [mutableImages addObject:[UIImage imageNamed:obj]];//here comes the error
    NSLog(@"The array mutable is è %@", mutableImages);
  }
  NSLog(@"The array of images %@", mutableImages);
  
  self.viewImages.animationImages = [NSArray arrayWithArray:mutableImages];
  
  self.viewImages.animationDuration =3;
  self.viewImages.animationRepeatCount= 0;
  [self.viewImages startAnimating];
  </code></pre>