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
Post a Comment