1、播放音效
需要导入AVFoundation库 导入头文件
<AVFoundation/AVFoundation.h>
具体方法:
NSURL *url = [[NSBundle mainBundle] URLForResource:@"activity_yao_2.caf" withExtension:nil];
SystemSoundID soundID = 0;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
AudioServicesPlaySystemSound(soundID);