Question

http://mobile.gunsel.ua/index.php?r=Rupages&jsonRequest={"id_page":"2"}

So,how can I create a NSURL(and after request) from this URL.(I use NSJSONSerilization). I'm new to iOS development please help me. Thank You!

Don't offer links on apple documentation.

Était-ce utile?

La solution 2

i'm found out!! This is was associated with Encoding)))

NSString sampleUrl = @"mobile.gunsel.ua/index.php?r=Rupages&jsonRequest={\"id_page\":\"2\"}";

 NSString encodedUrl = [sampleUrl stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];

Autres conseils

Not sure I get what you are asking, but you can use a string, then format it with your JSON (I.e concatenate the params), then create an NSUrl from that string.

 stringWithFormat

Should do the trick.

I'm not sure if that answered your question, but you need to elaborate if that's not the case.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top