iOS编程:在XML中发布JSON

iOS编程:在XML中发布JSON,xml,ios,json,asihttprequest,Xml,Ios,Json,Asihttprequest,我有一个api响应,如下所示: <root> <child> <otherKey>Some Object</otherKey> <notification>{"messages":1,"request":1}</notification> </child> </root> NSString *notification = [NSString stringWithFormat:@

我有一个api响应,如下所示:

<root>
  <child>
    <otherKey>Some Object</otherKey>
    <notification>{"messages":1,"request":1}</notification>
 </child>
</root>
NSString *notification = [NSString stringWithFormat:@"{\"messages\":%d,\"request\":%d}", shallNotifyMessage, shallNotifyRequests];
但当我像这样更新通知时:

<root>
  <child>
    <otherKey>Some Object</otherKey>
    <notification>{"messages":1,"request":1}</notification>
 </child>
</root>
NSString *notification = [NSString stringWithFormat:@"{\"messages\":%d,\"request\":%d}", shallNotifyMessage, shallNotifyRequests];
下次我查询时,它会给我这个响应:

<notification>{&amp;quot;messages&amp;quot;:1,&amp;quot;request&amp;quot;:1}</notification>

1.解析XML并提取JSON字符串,然后解析JSON。2.无法根据API响应来确定这一点。服务器需要什么样的请求,您需要向其发送什么数据?@aroth,我编辑了我的问题,忘记了解析,只将其更改为发布,谢谢:D