I am creating an iOS application that makes requests GETto a url. For all the requests he makes, I build the URL from the base URL and add parameters using NSDictionaryKey-Value_pairs.
I also use AFNetworking 2.0to make a request - it also creates a URL, with NSDictionary keys provided.
Now I have a problem when I want to use a web service, which requires that several keys are the same, with different values. This function is not possible whenNSDictionary
This means that I cannot successfully start the web service.
Here is an example of what I need for the url to finally look -
http://demo.domain.net/services/ ..... & IncludedUserIds = 12345 & IncludedUserIds = 2345
The bright bit of the above URL is what I'm trying to build using AFNetworking and NSDictionary. I suspect that I will have to use something more advanced than NSDictionary to remove this.
Does anyone have any ideas?
Edit
Half solutions were found if I set NSDictionary parameters like NSSet:
[self.parameters setObject:[NSSet setWithObjects:@"12345",@"2345", nil] forKey:@"IncludedUserIds"];
It works the way I need. However, I have the following question:
Values must be dynamically added to the NSSet - how do I create an NSSet that can take extra values at runtime?
source
share