Calling JSON web service with parameters - Objective C - iOS

后端 未结 3 1412
暗喜
暗喜 2021-02-08 20:31

I\'m trying to call a simple JSON webservice with a parameter in objective c. Doesn\'t work so far.

Here is the web service method:

[WebMethod]
[ScriptMe         


        
3条回答
  •  太阳男子
    2021-02-08 21:23

    For the iOS part,

    Your code looks OK. There should be no problem on the client side. But you can do the following debuggings;

    • Just before you call sendSynchronousRequest:returningResponse:error insert a breakpoint and check if your jsonData is valid. Because you are not checking the error you assigned for JSON Serialization.
    • If there is no problem with your JSON data, find another basic JSON server and try consuming it. If your client-side works, you will know there is something wrong on your server-side.

    Cheers

提交回复
热议问题