如何在FMDB数据库中快速存储数组?

时间:2018-07-31 09:11:56

标签: arrays swift uitableview fmdb

我是快速编程中的数据库新手。我正在使用FMDB数据存储数据并脱机显示它。我被困在一件事情上:我正在获取一个JSON响应(我在下面粘贴了JSON响应),现在我想在线存储时在表格视图中填充FMDB中的“问题”键,然后离线将该键填充到我的表视图中。我只想从JSON响应中保存“问题”键,然后离线时在表视图中填充它。提前致谢!!这是我的JSON响应-

{
    "error": false,
    "data": {
        "results": [
            {
                "id": "25",
                "question": "Cleaning of equipment, food premises is done as per cleaning schedule & cleaning programme.",
                "score": "2",
                "section": "3"
            },
            {
                "id": "26",
                "question": "Preventive maintenance of equipment and machinery are carried out regularly as per the instructions of the manufacturer.",
                "score": "2",
                "section": "3"
            },
            {
                "id": "27",
                "question": "Measuring & monitoring devices are calibrated periodically.",
                "score": "2",
                "section": "3"
            },
            {
                "id": "28",
                "question": "Pest control program is available & pest control activities are carried out by trained and experienced personnel. Check for records.",
                "score": "4",
                "section": "3"
            },
            {
                "id": "29",
                "question": "No signs of pest activity or infestation in premises (eggs, larvae, faeces etc.)",
                "score": "2",
                "section": "3"
            },
            {
                "id": "30",
                "question": "Drains are designed to meet expected flow loads and equipped with traps to capture contaminants.",
                "score": "2",
                "section": "3"
            },
            {
                "id": "31",
                "question": "Food waste and other refuse are removed periodically from food handling areas to avoid accumulation. ",
                "score": "2",
                "section": "3"
            },
            {
                "id": "32",
                "question": "Disposal of sewage and effluents is done in conformity with standards laid down under Environment Protection Act, 1986.",
                "score": "2",
                "section": "3"
            }
        ]
    },
    "message": "find data successfully"
} 

0 个答案:

没有答案