-2
我試圖NSTimer.scheduledTimerWithTimeInterval
。我有字符串,我得到的int與substringToIndex
然後im轉換爲int值與toInt()
但NSTimer不接受。NSTimer不接受ToInt()
var Time = CleanText.substringToIndex(advance(CleanText.startIndex, 2))
let time2:Int = Time.toInt()!
var timer = NSTimer.scheduledTimerWithTimeInterval(time2, target: self, selector: Selector(""), userInfo: nil, repeats: false)
解決方法是什麼?
你看看在[文檔的NSTimer(https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/#// apple_ref/OCC/CLM /的NSTimer/scheduledTimerWithTimeInterval:目標:選擇器:USERINFO:重複:)?第一個參數的類型是什麼? –