is there a class available to check if an array doesn't contain an object? I want to do something like
if [(myarray doesntContain @"object")]
is this possible
isArray() method is used to check if an object is an array. The Array. isArray() method returns true if an object is an array, otherwise returns false .
You can iterate through the array, check and see if any of the objects has the key that you are looking for, and return true if it does. If you don't find the key, then the for loop will complete and it will return false.
For NSArray
use -containsObject:
:
if (![myarray containsObject:someObject]) { // ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With