I created a multidimensional array, but when I try to access it in viewDidLoad the application crashes. Any suggestions as to why this is happening?
I also tried to define my array as var data: KeyLabelType[][], but that didn't help either.
class MyViewController: UIViewController {
var data: Array<Array<KeyLabelType>> = []
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
let array1: KeyLabelType[] = [...]
let array2: KeyLabelType[] = [...]
let array3: KeyLabelType[] = [...]
self.data = [array1, array2, array3]
super.init(nibName: nibNameOrNil, bundle: nibBundle)
}
override func viewDidLoad() {
let count = self.data.count // Application crashes here
}
}

EDIT:
I declared KeyLabelType as
enum KeyLabelType: Character {
case a = "a"
case b = "b"
case c = "c"
}
EDIT: I filed a bug report with Apple (17340589)
KeyLabelTypeclass declared? I just tested your code in both playground and an app and it is working. I declared it asclass KeyLabelType {}.KeyLabelTypeas anenum. I there something I'm missing?viewDidLoad, but I'm still getting the same error. I setself.data=[]in the initializer and then populateddatainviewDidLoad.