Rahul Mathur
Rahul Mathur

Reputation: 882

Ambiguous reference to member 'count'

Getting the following error when i migrated my current Xcode (v 7.0.1) project to Xcode 7.1.1

Any idea how to resolve above errors?

My code is as follows

  var arrOfRewardDetail : Array = [Dictionary<String, String>]()
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) ->  Int {
    return arrOfRewardDetail.count //Ambiguous reference to member 'count'
}

 if self.arrOfRewardDetail[indexPath.row]["KEY"] == "Promotion By : "{} // Cannot subscript a value of type 'Array'

Update Now getting the following errors

Upvotes: 4

Views: 13548

Answers (1)

Eric Aya
Eric Aya

Reputation: 70097

Just remove the : Array part:

var arrOfRewardDetail = [Dictionary<String, String>]()

The compiler will infer the right type, which is [Dictionary<String, String>], not just Array.

Upvotes: 9

Related Questions