我試圖在迅速和按鈕點擊開始創建一個簡單的線程,但它拋出一個錯誤創造了快捷簡單的線程給出錯誤
"**Cannot find an initializer for type 'NSThread' that accepts an argument list of type ('target:ViewControllerm->())'**
這裏是我的代碼:
import UIKit
class ViewController: UIViewController {
var isSet = true
let thread123 = NSThread(target: self, selector: "myFunc", object: nil)
func myFunc() {
}
@IBAction func btnClickEvent(sender: AnyObject) {
// starting thread
thread12.start()
}
}
我在這裏做錯了什麼?
感謝..這也適用.. – cybergeeeek