导入头文件
#import <AVFoundation/AVFoundation.h>
使用AVFoundation框架
创建一个soundID对象
SystemSoundID soundID
将本地资源的url交给这个soundID
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
播放这个soundID中的音乐对象
AudioServicesPlaySystemSound(soundID);
#import <AVFoundation/AVFoundation.h>
SystemSoundID soundID
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
AudioServicesPlaySystemSound(soundID);