Thursday, August 16, 2018

#1 2018-06-14 03:37:06 pm

jcwelch
Member
Registered: 2009-09-11
Posts: 48

Search NSArray for string

I have an NSArray with multiple elements that each look like:

serverName:"name1"
serverURL:"https://nam1.com"
serverAPIKey:"asdfasdfasdf"


what I want to do is get the index for the string "name1" or whatever that happens to be, but reading the docs and trying to find examples elsewhere has been less than fruitful. I know I could just do it as a list of records and interate, but if there's a better way to do it, I'd much rather do that.

Last edited by jcwelch (2018-06-14 03:37:37 pm)

Offline

 

#2 2018-06-14 04:58:47 pm

jcwelch
Member
Registered: 2009-09-11
Posts: 48

Re: Search NSArray for string

I think there's something about asking a question...figured out NSPredicate for this. Yay!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)