ios - How can i build a URL with same key multiple times? -


i'm building ios app makes get requests url. requests makes, build url off base url , add parameters using nsdictionary key-value_pairs.

i use afnetworking 2.0 make request - builds url well, nsdictionary keys supplied.

i have run problem, web service need use, requires multiple keys same, different values. functionality not possible nsdictionary

which means cannot run web service successfully.

here example of need url -

http://demo.domain.net/services/.....&includeduserids=12345&includeduserids=2345

the italic bit of above url trying build using afnetworking , nsdictionary. suspect have use little more advanced nsdictionary pull off.

does have ideas?

edit

found half solutions if set nsdictionary parameters nsset:

    [self.parameters setobject:[nsset setwithobjects:@"12345",@"2345", nil] forkey:@"includeduserids"]; 

this works need to. have follow question:

the values need dynamically added nsset - how create nsset can accept values @ runtime?

i managed solve issue:

i created objects in nsdictionaray so:

    [self.mydictionary setobject:[nsset setwitharray:self.myarray] forkey:@"mykeyneeded]; 

the array has nsstring objects in , seems work perfectly. used array instead of nsmutableset due needing remove objects enough nsdictionary.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -