我正在尝试为iOS构建消息传递应用程序。我有一个返回JSON的Web服务,但我不知道如何让它显示在应用程序的可滚动,格式化的区域。我也对如何让它ping服务器以检查更新一无所知,并且如果已经发布了流,则刷新流。我们将非常感谢您提供的任何帮助。
这是我正在使用的基本JSON:
{
"messages": [
{
"id": "1",
"location_id": "1",
"origination_id": "1",
"message": "Test message",
"timestamp": "2014-01-16 08:57:26"
},
{
"id": "2",
"location_id": "1",
"origination_id": "1",
"message": "Test Message - start",
"timestamp": "2014-01-16 09:00:50"
},
{
"id": "3",
"location_id": "1",
"origination_id": "2",
"message": "Test response",
"timestamp": "2014-01-16 09:01:06"
},
{
"id": "6",
"location_id": "1",
"origination_id": "1",
"message": "This is a test message from the API",
"timestamp": "2014-01-16 10:23:11"
},
{
"id": "7",
"location_id": "1",
"origination_id": "1",
"message": "This is a test message from the API",
"timestamp": "2014-01-16 10:23:13"
},
{
"id": "8",
"location_id": "1",
"origination_id": "1",
"message": "This is a test message from the API",
"timestamp": "2014-01-16 10:23:22"
}
]
}