首先对不起我的英语
我的代码有问题,我尝试做一个健全的程序,但在我的代码中出现了这个错误:
Invalid operands to binary expression ('CFURLRef' (aka 'const struct __CFURL *') and 'CFURLRef')
这是我的完整代码:
- (IBAction)tocar:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef *CFBundleCopyResourceURL (mainBundle, (CFStringRef) @"Botao", CFSTR ("mp3"), NULL);
UInt32 SoundID;
AudioServicesCreateSystemSoundID(soundfileURLRef, &SoundID);
AudioServicesPlaySystemSound(SoundID);
}