I am trying to iterate over nested dict from plist file. Problem is with type mismatch while decomposing contents. I always get errors that NSObject, NSDict and other NSstuff cannot be translated to String variables including when I use "(value)", string(), as .. How to decompose a plist dict sub sets tuple?(array) into separate variables?
func LoadPlistContacts() {
let path = NSBundle.mainBundle().pathForResource("ContactList", ofType: "plist")
var AppContactsList = NSDictionary(contentsOfFile: path!)
ListKeys = sorted(AppContactsList!.allKeys as! [String])
for key in ListKeys {
var (AppPersonName, AppPersonSurname, AppPersonCompany, AppPersonPhone) = AppContactsList[key]
}
}
UPDATED: I have altered the plist with Dictionaries instead of Arrays and updated the code, yet type mismatch persists. As Airspeed Velocity and nhgrif point out in comments, example did got messier with updated plist. Should I do nested for cycles if the line with the commented error does not solve it? Thanks.

var ListKeys: [String]!
var ListContacts: [String: String]!
func LoadPlistContacts() {
if let path = NSBundle.mainBundle().pathForResource("ContactList", ofType: "plist") {
var AppContactsList = NSDictionary(contentsOfFile: path)
ListKeys = sorted(AppContactsList!.allKeys as! [String])
ListContacts = sorted(AppContactsList!.allValues as [String:String]) { $0.0 < $1.0 }
// I get an error [AnyObject] is not convertible to '[String:String]'
for contact in ListContacts {
let name = contact["Forename"] ?? ""
let surname = contact["Surname"] ?? ""
let address = contact["Company"] ?? ""
let phone = contact["Phone"] ?? ""
}
}
else {
fatalError("Could not open Contacts plist")
}
}
Btw, Airspeed Velocity, love your blog!
