How might I check if a particular NSString is present in an NSArray?

前端 未结 3 486
执念已碎
执念已碎 2020-12-17 09:15

How might I check if a particular NSString is presnet in an NSArray?

3条回答
  •  死守一世寂寞
    2020-12-17 09:53

    Depends on your needs. Either indexOfObject if you care about equality (most likely), or indexOfObjectIdenticalTo if you care it's actually the same object (i.e. same address).

    Source:

    • NSArray Class Reference

提交回复
热议问题