みなさん、こんにちは。このコードを2つのパラメーターを持つ関数に変換する必要があります。この場合、最初のパラメーターはNewsで、2番目のパラメーターはaifでこれを実行できますか?
-(IBAction)news
{
CFURLRef soundFileURLRef;
SystemSoundID soundFileObject;
CFBundleRef mainBundle;
mainBundle = CFBundleGetMainBundle ();
// Get the URL to the sound file to play
soundFileURLRef = CFBundleCopyResourceURL (mainBundle,
CFSTR ("News"),
CFSTR ("aif"),
NULL);
// Create a system sound object representing the sound file
AudioServicesCreateSystemSoundID (soundFileURLRef, &soundFileObject);
AudioServicesPlaySystemSound (soundFileObject);
return;
}