title: Swift - Error Accessing Data From Dictionary with Array of Dictionaries
body: <p>I have a very simple example of what I'd like to do</p>
  
  <pre><code>private var data = [String: [[String: String]]]()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      let dict = ["Key": "Value"]
      data["Blah"] = [dict, dict]
  }
  
  @IBAction func buttonTap(sender: AnyObject) {
      let array = data["Blah"]
      let dict = array[0] //&lt;---- error here
      println(dict["Key"])
  }
  </code></pre>
  
  <p>Basically, I have a dictionary whose values contain an array of [String: String] dictionaries. I stuff data into it but when I go to access the data, I get this error:</p>
  
  <blockquote>
    <p>Cannot subscript a value of type '[([String : String])]?' with an
    index of type 'Int'</p>
  </blockquote>
  
  <p>Please let me know what I'm doing wrong.</p>