■ このスレッドは過去ログ倉庫に格納されています
Swift part9
- 954 :デフォルトの名無しさん (ワッチョイ db3c-yXFx):2017/02/18(土) 11:44:02.26 ID:NSF889Ks0.net
- >>953
// エラーが起きたとき
if let error = audioError {
print("Error \(error.localizedDescription)"
)
}
audioPlayer.delegate = self
audioPlayer.prepareToPlay ()
}
// ボタンがタップされた時の処理
@IBAction func button(_ sender: AnyObject
) {
if ( audioPlayer.isPlaying ){
audioPlayer.stop()
button.setTitle("Stop", for: UIControlState
())
}
else{
audioPlayer.play()
button.setTitle("Play", for: UIControlState
())
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
ボタンを押すと音がなるアプリを作りたくて上記のコードで実行してみたんだけど「SIGABRT」「NSInvalidArgumentException」「unrecognized selector sent to instance」
こんなエラーが出る
初心者でおかしな質問してるかもしれない
もしよかったらどこを直せばいいか教えてほしい
総レス数 1000
303 KB
新着レスの表示
掲示板に戻る
全部
前100
次100
最新50
read.cgi ver 2014.07.20.01.SC 2014/07/20 D ★