Iphone 按钮点击时的声音效果

Iphone 按钮点击时的声音效果,iphone,button,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/Ap

我在代码中添加了音效。但当我启动我的应用程序,第一次点击按钮,它需要一些时间,然后工作。它只发生在第一次点击,否则在其他按钮点击它的工作速度很快。它向我显示了一些错误,比如

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

这件事发生在我身上。我从来没有弄清楚它发生的确切原因,但它只是在模拟器中运行时发生的

此外,如果您使用
AVFoundation
播放音频,请确保调用
prepareToPlay
。这样做有助于开始播放声音所需的时间