ios - How to find the first index in array of dictionaries whereby the 'name' key begins with a certain letter? -


ok ones had me stumped while.

how can find first index in array of dictionaries whereby key begins letter provided?

my array contains 2500 dictionaries, each have name, longitude , latitude key. have letter @"s" how find index first dictionary in array whereby value key 'name' begins s?

you use indexesofobjectspassingtest: (it provides stop bool can stop iteration). inside block, name dictionary. assuming want exact match source string against start of name, use hasprefix: check. set stop flag when match.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -