【发布时间】:2011-11-06 10:42:12
【问题描述】:
我正在开发一个音板应用程序,当我分析我的应用程序时,它总是会检测到内存泄漏。它在 iOS 模拟器上运行良好,但大多数声音在实际设备上不起作用。我认为这与内存泄漏有关。有小费吗。这是代码。它只是所有代码的一个 sn-p。我正在使用音频工具箱。抱歉,在此先感谢您,我是新手。
#import "hilarioussoundboardipViewController.h"
@implementation hilarioussoundboardipViewController
-(IBAction)sound2 {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"sound2", CFSTR ("wav"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID); //it says there is a potential memory leak here//
}
【问题讨论】:
-
嘿,感谢所有发帖的人,但错误不是泄漏,而是文件类型兼容性问题。
标签: ios xcode memory-leaks xcode4 audiotoolbox