Initialising empty arrays of dictionaries in Swift

You need to give types to the dictionaries:

var myNewDictArray: [Dictionary<String, Int>] = []

or

var myNewDictArray = [Dictionary<String, Int>]()

Edit: You can also use the shorter syntax:

var myNewDictArray: [[String:Int]] = []

or

var myNewDictArray = [[String:Int]]()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)