Dotinstalのレッスン(#07 停止処理、リセット処理を実装しよう 有料版)を受けてい、お手本のとおりにタイプしたのですが、下記の部分にさしかかると、自分のxcodeでは"NSSNSString is not implicitly convertible to String: did you mean to use as to explicitly convert?"というエラーが出て来ます。Suggestionの通りに、下記のコードの最後に”as String”をつけると実行は可能なのですが、その際は”libc++abi.dylib: terminating with uncaught exception of type NSException”という表示がでてきて、実行できません。
func update() {
if let t = self.startTime {
let time: Double = NSDate.timeIntervalSinceReferenceDate() - t + self.elapsedTime
let sec: Int = Int(time)
let msec: Int = Int((time - Double(sec)) * 100.0)
self.timerLabel.text = NSString(format: "%02d:%02d:%02d", sec/60, sec%60, msec)
部分的な説明で大変わかりにくいと思われますが、よろしければ解答よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/06/18 23:31