swift - NSArray with contents of file not work in ios -
i trying json array json file in ios. problem code not working content in json file is:
[{a:"m",data:"1597,144",tick:1},{a:"m",data:"1595,144",tick:1}, ...] this swift code:
if let filepath = nsbundle.mainbundle().pathforresource("data", oftype: "json") { let array = nsmutablearray(contentsoffile: filepath) println("\(array)") } the file exists @ path reason not working. null when try print array.
nsmutablearray(contentsoffile: filepath) work property lists:
what have json string. if want load array json file check out this: how parse json file in ios?
Comments
Post a Comment