How to check if a NSMutableArray contains a value (null) or not?

11,393

NSMutableArray can only contain non-nil objects. Objects that print as (null) are typically nil.

The superclass method containsObject: will tell you whether a particular non-nil object is in the array. Note that this will only work if the objects are identical according to isEqual:.

Share:
11,393
raaz
Author by

raaz

hi, i m an iOS developer.

Updated on June 05, 2022

Comments

  • raaz
    raaz almost 2 years

    I have an NSMutableArray instance which contains "N" number of objects and I want to check whether NSMutableArray contains a (null) or any other value.

    In NSString there is a method called isEqualToString: Is there a similar method available for NSMutableArray?

    Or otherwise, how can I do this?