简体   繁体   中英

lldb error in Swift - variables not initializing?

I am new to Swift and have very little experience in Objective-C. This is all I have in my view controller class.

var wordString = [String]()


func CallData() {
     self.wordString.append("example string")
}

override func viewDidLoad() {
super.viewDidLoad()
CallData()
println(wordString[0])
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}

Why am I getting an "lldb" error and occasionally an "index empty buffer"?

The code compiles and runs fine for me without any error. What version of Xcode are you running? I am running 6.1.1. Perhaps you need to update?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM