Search code examples
iphonearraysfindnsindexpath

Array, find object with value and get its indexPath


I am trying to find an item in a NSMutableArray from it's value, only to find its indexPath.

I have absolutely no idea of how to do this, as I am very new to programming in general.

Thanks!


Solution

  • Are you perhaps looking for - indexOfObject:? This method returns the index on which the object specified can be found in the NSArray (from which NSMutableArray inherits) on which the method is ran.