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.

有帮助吗?

解决方案 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];

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top