Is there a method, like containsObject: for NSMUtableArrays to check if an object exists in there without having to loop through the whole array and check each element? What’s the best way to check if an object exists in an NSMutableArray?
Is there a method, like containsObject: for NSMUtableArrays to check if an object exists
Share
If you’re mostly using an array to check if an object exists, and you’re using unique elements, you may want to use an
NSSet. Checking a set for membership is faster than checking an array.