Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios json日期如何存储在数组中_Ios_Swift - Fatal编程技术网

Ios json日期如何存储在数组中

Ios json日期如何存储在数组中,ios,swift,Ios,Swift,试过这件不工作的。试过这件不工作的。你得到结果的结果,让我们得到结果,让Da1和让dat,让dat,让Da1和让dat,如果是的显示结果,如果是的,如果是显示结果的结果,让他们获得的结果。获得的代码代码:200{数据={数据={“收缩期bp”bp的bp(bp)bp\:::::“28\,“28\”,,“反试试”你你得到这件工作。你得到这件。你得到结果。你得到结果。你得到的结果。我们得到结果,让我们得到结果,让我们得到结果,让dat,让dat,让dat,让dat和让dat,让dat,让dat,让da

试过这件不工作的。试过这件不工作的。你得到结果的结果,让我们得到结果,让Da1和让dat,让dat,让Da1和让dat,如果是的显示结果,如果是的,如果是显示结果的结果,让他们获得的结果。获得的代码代码:200{数据={数据={“收缩期bp”bp的bp(bp)bp\:::::“28\,“28\”,,“反试试”你你得到这件工作。你得到这件。你得到结果。你得到结果。你得到的结果。我们得到结果,让我们得到结果,让我们得到结果,让dat,让dat,让dat,让dat和让dat,让dat,让dat,让dat,如果是显示结果,如果是,如果是,如果是显示结果得到的结果。获得的结果。获得的获得的结果。获得的政府代码代码代码代码代码:取得的结果。取得的结果。代码:政府代码:\“A:1:{s:4:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
 data = "{\"2\":{\"Systolic_bp\":\"28\",\"Dystolic_bp\":\"29\",\"Weight\":\"22\",\"Height\":\"24\",\"Pulse\":\"26\",\"Temp\":\"25\",\"Respiration\":\"27\",\"BMI\":\"A:1:{s:4:\\\"SPO2\\\";s:1:\\\"1\\\";}\",\"BSA\":\"A:1:{s:4:\\\"SPO2\\\";s:1:\\\"1\\\";}\",\"tcomplients\":\"\",\"drdate\":\"25\\/08\\/2014\",\"medicine\":\"RABEPRAZOLE\",\"drugclass\":\"Tablet\",\"dosage\":\"1\",\"duration\":\"5 day\",\"frequency\":\"\",\"route\":\"Oral\",\"drnotes\":\"\"},\"1\":{\"tcomplients\":\"\",\"drdate\":\"25\\/08\\/2014\",\"medicine\":\"ACECLOFENAC+PARACETAMOL\",\"drugclass\":\"Tablet\",\"dosage\":\"1\",\"duration\":\"5 day\",\"frequency\":\"\",\"route\":\"Oral\",\"drnotes\":\"\"}}";   
            let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers , error: &error) as NSDictionary


            println(jsonData)

            let dat1:NSString = jsonData.valueForKey("status")as NSString
            let dat:NSString = jsonData.valueForKey("data") as NSString
            if(dat1 == "SUCCESS")
            {
            // NSLog("Success: %d", jsonData);

                var fullName: String = dat
               // NSLog(fullName)

               //firstName = "vinod"


                let fullNameArr = fullName.componentsSeparatedByString(":")
                //NSLog(fullName)

               firstName  = fullNameArr[0]
                lastName  = fullNameArr[1]
                sex       = fullNameArr[2]
                Dob       = fullNameArr[3]
                encounter = fullNameArr[4]
                consultDR = fullNameArr[5]
               // room      = fullNameArr[6]
                //bed       = fullNameArr[7]
                //doa       = fullNameArr[8]
                //wardno    = fullNameArr[9]

                NSLog(fullNameArr[0])
                NSLog(fullNameArr[1])
                NSLog(fullNameArr[2])
                NSLog(fullNameArr[3])
                NSLog(fullNameArr[4])
                NSLog(fullNameArr[5])
               // NSLog(fullNameArr[6])
               // NSLog(fullNameArr[7])
               // NSLog(fullNameArr[8])
                //NSLog(fullNameArr[9])
let jsonString = "{\"2\":{\"Systolic_bp\":\"28\",\"Dystolic_bp\":\"29\",\"Weight\":\"22\",\"Height\":\"24\",\"Pulse\":\"26\",\"Temp\":\"25\",\"Respiration\":\"27\",\"BMI\":\"A:1:{s:4:\\\"SPO2\\\";s:1:\\\"1\\\";}\",\"BSA\":\"A:1:{s:4:\\\"SPO2\\\";s:1:\\\"1\\\";}\",\"tcomplients\":\"\",\"drdate\":\"25\\/08\\/2014\",\"medicine\":\"RABEPRAZOLE\",\"drugclass\":\"Tablet\",\"dosage\":\"1\",\"duration\":\"5 day\",\"frequency\":\"\",\"route\":\"Oral\",\"drnotes\":\"\"},\"1\":{\"tcomplients\":\"\",\"drdate\":\"25\\/08\\/2014\",\"medicine\":\"ACECLOFENAC+PARACETAMOL\",\"drugclass\":\"Tablet\",\"dosage\":\"1\",\"duration\":\"5 day\",\"frequency\":\"\",\"route\":\"Oral\",\"drnotes\":\"\"}}"


if let jsonData = jsonString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) {
    var error: NSError?
    if let jsonDict = NSJSONSerialization.JSONObjectWithData(jsonData, options: NSJSONReadingOptions.MutableContainers, error: &error) as? [String:AnyObject] {
        let dicKeys = jsonDict.keys.array
            for key in dicKeys {
                println("\n")
                if let subDic = jsonDict[key] as? [String:String] {
                    let subDicKeys = subDic.keys.array
                    for sKey in subDicKeys {
                        println(sKey + " = " + subDic[sKey]! )
                    }
                }
            }
    } else {
        println(false)
    }
} else {
    println(false)
}