I have following string , which i want to append with NSURL and after appending i want the result in NSURL
{ “deviceid”:”3c27c99ac4b159aca81de8f5d266478f00000000 “,”nickname”:”sad”,”gender”:0,”marital”:0,”children”:1,”job”:”asd”,”message”:”Asd”,”pushid”:”3c27c99ac4b159aca81de8f5d266478f00000000″}
Can , Anybody help me please .
Thanks in advance .
You haven’t stated what you expect the final URL to look like, so I have assumed you want to add the names and values from your record string as a query string to the original URL.
The following method will return a combined URL when given a base URL and string like the one you have provided above:
When tested with the following code:
The output is:
The method provided assumes that there are no erroneous spaces in the record string and that the names and values in the record only contain ASCII numbers and letters. It will return a nil value if the record contains names or values that contain URL problem characters (such as a space). If you suspect that such characters will be involved, you will need to rewrite the method accordingly – replacing such characters with URL escape codes.