i have a problem i want to get data from a plist file and put it to an array variable but it doesnt work
let path = Bundle.main.path(forResource: "SampleData", ofType: "plist")
let dataArray = NSArray(contentsOfFile: path!)!
but it doesnt work and has runtime error for NSArray return nil.
i found my problem . i have to set root in plist as a Array like the below pic , beacuse NSArray just can put array to a variable and it can't put a dictionary item to a variable: