Search through NSArray for string

后端 未结 3 693
心在旅途
心在旅途 2020-12-13 02:56

I would like to search through my NSArray for a certain string.

Example:

NSArray has the objects: \"dog\", \"cat\", \"fat dog\", \"thing\", \"another thing\"

3条回答
  •  醉梦人生
    2020-12-13 03:16

    It would not work because as per document "indexOfObjectIdenticalTo:" returns the index of the first object that has the same memory address as the object you are passing in.

    you need to traverse through your array and compare.

提交回复
热议问题