【发布时间】:2015-10-20 13:58:56
【问题描述】:
当我的应用加载时,屏幕上会出现一个麦克风。当您点击麦克风时,会弹出一个标有“录音”的标签以及一个停止按钮。当您点击停止按钮时,应用程序崩溃。
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var recordingInProgress: UILabel!
@IBOutlet weak var stopButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidAppear(animated: Bool) {
//Hides the stop button
stopButton.hidden = true
}
@IBAction func recordAudio(sender: UIButton) {
//Shows the stop button
stopButton.hidden = false
//Shows the recording label
recordingInProgress.hidden = false
//TODO: Record Audio
print("Recording in Progress.")
}
这是我的崩溃报告:
正在录制。 正在录制。 2015-10-20 15:44:48.247 Vex[1468:533404]-[Vex.ViewController stopButton:]:无法识别的选择器发送到实例 0x14d5418a0 2015-10-20 15:44:48.253 Vex[1468:533404] * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[Vex.ViewController stopButton:]:无法识别的选择器发送到实例 0x14d5418a0” * 首先抛出调用栈: (0x183be4f5c 0x1987dbf80 0x183bebc6c 0x183be8c14 0x183aecdcc 0x1891723c8 0x189172344 0x18915ac6c 0x189171c5c 0x18917188c 0x18916aac0 0x18913ba10 0x189139efc 0x183b9c5a4 0x183b9c038 0x183b99d38 0x183ac8dc0 0x18ec1c088 0x1891a2f44 0x1000322b0 0x1990068b8) libc++abi.dylib:以 NSException 类型的未捕获异常终止
【问题讨论】:
-
因什么而崩溃?崩溃消息/信号?等等?
-
显示您的崩溃报告
-
我添加了我的崩溃报告@LordZsolt
-
你的
stopButton(_:)函数在哪里?