当我尝试在 Xcode 上运行我的应用程序时,我不断收到“预期方法主体”错误。加粗的地方是我得到错误的地方。帮助!!!还有一件事,我在“@implementation SoundnoardFirstViewController”部分不断收到“不完整实现”的错误消息。帮助!!谢谢
#import "SoundnoardFirstViewController.h"
@interface SoundnoardFirstViewController ()
@end
@implementation SoundnoardFirstViewController
-(IBAction)PlaySound1:(id)sender1
**-(IBAction)PlaySound2:(id)sender2**
-(IBAction)PlaySound3:(id)sender3
-(IBAction)PlaySound4:(id)sender4
-(IBAction)PlaySound5:(id)sender5
-(IBAction)PlaySound6:(id)sender6
(IBAction)PlaySound1:(id)sender1:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"This is the name of the clip", CFSTR ("sound file type"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
-(IBAction)PlaySound2:(id)sender2:(id)sender{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"DoYouHave?", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
-(IBAction)PlaySound3:(id)sender3:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Hello", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
-(IBAction)PlaySound4:(id)sender4:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"SoupBetter?", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}