Pretty basic programming question, I know PHP have a function for it, but does the iPhone OS have one?
I want to check if the current indexPath is a value in an array.
PHP Example:
<?php
$indexPath = 3;
$array = array("0", "1", "2", "3", "4");
if (in_array($indexPath, $array)) {
// Do something
}
?>
Does anybody know how to do the same thing in iOS?
For example:
or to check an indexPath:
I should clarify that an
NSIndexPathis not a number but a series of numbers that "represents the path to a specific node in a tree of nested array collections" as explained in more detail in the developer documentation.