Find out which object being added to NSMutableArray is nil

Posted by Raphael Caixeta on Stack Overflow See other posts from Stack Overflow or by Raphael Caixeta
Published on 2012-06-27T02:50:51Z Indexed on 2012/06/27 3:16 UTC
Read the original article Hit count: 110

I started a project using ARC, and I'm inserting a few objects into an NSMutableArray. The objects have all started out as NSStrings, and when attempting to add these objects into the array, I get the following error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSArrayM insertObject:atIndex:]: object cannot be nil

This array is holding several objects. Is there a quick way for me to find which of the objects I'm attempting to put into the array is nil?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa