0

I am new in iOS, in android i call web service using basicnamevaluepair list in android but in iOS how it code? in android it's work fine but in iOS I send data in JSON dictionary format also try in string format but it's not working , what is equivalent of basicnamevaluepair in iOS

thanks

Code cracker
  • 3,009
  • 6
  • 32
  • 58
Ujesh
  • 1,618
  • 1
  • 22
  • 34

1 Answers1

2

Just like you use NameValuePairs in Android, in iOS NSDictionary is used. Using this you can store multiple values / objects (even arrays and stuff) using a key (which is equivalent to the Name part in NameValuePair)

Here is an example of how to use this.

Just for a quick overlook here is how it works in android

List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("key", "value"));

And here is how it works in iOS

NSDictionary *dict = @{"key" : @"Hello there!"};
Community
  • 1
  • 1
Ganesh Somani
  • 1,960
  • 2
  • 24
  • 37