2
我需要使用JSON創建動態表單。我已經解析了JSON,但我不知道如何動態創建表單。請建議一些代碼或教程。在iOS中使用JSON創建動態表單
[
{
"cssClass": "head"
},
{
"cssClass": "input_text",
"values": "Text Field",
"fieldsize": "small",
"required": "undefined",
"prevalue": "This is text field",
"autocaps": "none",
"fieldesc": "text field description"
},
{
"cssClass": "number",
"values": "Number ",
"fieldsize": "small",
"required": "required",
"prevalue": "This is Number Field",
"autocaps": "capitalize",
"fieldesc": "number field description"
},
{
"cssClass": "email",
"values": "Email",
"fieldsize": "small",
"required": "required",
"prevalue": "This is email field",
"autocaps": "none",
"fieldesc": "email field description"
},
{
"cssClass": "password",
"values": "Password",
"fieldsize": "small",
"required": "required",
"prevalue": "password",
"autocaps": "none",
"fieldesc": "password field description"
},
{
"cssClass": "date",
"values": "Date",
"fieldsize": "medium",
"required": "required",
"prevalue": "datefield",
"autocaps": "uppercase",
"fieldesc": "date field description"
},
{
"cssClass": "time",
"values": "Time",
"fieldsize": "small",
"required": "undefined",
"prevalue": "time field",
"autocaps": "uppercase",
"fieldesc": "time field description"
}
]
創建與各界類文件,然後將所有存儲在NSArray中,並傳遞給表視圖,一旦你從WS –
獲取數據u可以給一些這方面的鏈接或代碼示例重新加載數據 – user1190239