按钮单击时的声音效果

时间:2012-07-17 07:39:43

标签: iphone button

我在代码中添加了声音效果。但是,当我启动我的应用程序并首先点击按钮时,需要一些时间才能工作。它只在第一次点击时发生,否则在其他按钮点击它快速工作。它向我显示了像

这样的错误
2012-07-17 12:51:22.240 PainReporter[6882:16503] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security

1 个答案:

答案 0 :(得分:1)

我发生了这件事。我从来没有弄清楚它究竟发生的原因,但它只发生在模拟器中运行时。

除此之外,如果您使用AVFoundation播放音频,请务必致电prepareToPlay。这样做有助于开始播放声音所需的时间。