since I update the xcode 10.1, this error occur.
The code is:
class mainPageJobObj {
var _id : String = ""
var avatar :String = ""
var name : String = ""
var serviceState = ""
}
items : [mainPageJobObj]!
items // i read it from server and its not empty
let oneItem = items[index] // Fatal error: NSArray element failed to match the Swift Array Element type -- This is what compiler is showing.

itemsdoesn't contain instances ofmainPageJobObj. You need to showreadItemsFromServerfor a better answerReadItemsFromServer()is not returning the array ofmainPageJobObjhere.itemsis an array of dictionaries, not an array ofmainPageJobObj