2012-12-12 35 views
-3

我已經嘗試了一切嘗試和修復它我讀過其他類似的問題,但沒有任何工作。Xcode意外的@錯誤

#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 
+2

結束想着「}」,如果你提供的是您收到確切的錯誤消息,這將是有益的,但我我會猜測這個錯誤是因爲IBAction沒有右括號。 –

回答

0
  • 刪除 ';'在方法標題行
  • 你在你的方法(@end前右)
+0

謝謝你的工作 –