Objective c Xcode意外@错误
我已经尝试了所有的方法来解决这个问题,我通读了其他类似的问题,但是没有任何效果Objective c Xcode意外@错误,objective-c,Objective C,我已经尝试了所有的方法来解决这个问题,我通读了其他类似的问题,但是没有任何效果 #import "ViewController.h" //sound @implementation SoundappViewController -(IBAction)play; { CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef soundFileURLRef; soundFileURLRef = CFBundleCopyResourceURL
#import "ViewController.h"
//sound
@implementation SoundappViewController
-(IBAction)play; {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"app 3", CFSTR ("m4a"), NULL);
UInt32 (soundID);
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
@end // Here i get the error Unexpected @ in program
- 删除“;”方法中的标题行
- 您在方法末尾缺少“}”(就在@end之前)
}
。