简体   繁体   English

按下按钮时应用退出

[英]App Quits when button is pressed

i am making a soundboard app and when i run it in Xcode, after i click one of the buttons to play the sound i get an error. 我正在制作一个音板应用程序,当我在Xcode中运行它时,单击一个按钮播放声音后出现错误。 This is the Log of the crash 这是崩溃的日志

2012-07-14 20:24:34.395 SoundBoard[15374:c07] Could not load the "BG.png" image referenced from a nib in the bundle with identifier "Apple.SoundBoard" 2012-07-14 20:24:41.645 SoundBoard[15374:c07] -[ViewController playSound1]: unrecognized selector sent to instance 0x93a99b0 2012-07-14 20:24:41.648 SoundBoard[15374:c07] (null) libc++abi.dylib: terminate called throwing an exception (lldb) 2012-07-14 20:24:34.395 SoundBoard [15374:c07]无法加载从标识符为“ Apple.SoundBoard”的捆绑包中的笔尖引用的“ BG.png”图像2012-07-14 20:24:41.645 SoundBoard [15374:c07]-[ViewController playSound1]:无法识别的选择器发送到实例0x93a99b0 2012-07-14 20:24:41.648 SoundBoard [15374:c07](空)libc ++ abi.dylib:终止调用引发异常( lldb)

Any help? 有什么帮助吗? i can't figure it out 我不知道

Thanks 谢谢

您尚未在ViewController类上定义-playSound1方法。

You have no implementation of -playsound1 on your view controller. 您的视图控制器上没有实现-playsound1。 It's defined in the header, but not implemented, hence the warning. 它在标头中定义,但未实现,因此出现警告。

Just implement the method (making it play a sound) and it'll work. 只需实现该方法(使它播放声音)即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM