アプリをロードしたときに再生したいサウンドファイルがありますが、ボタンを押したときにしか再生できません。.hファイルが必要ですか、それとも.mファイルのみで機能しますか?
#import "ViewController.h"
//sound
@implementation ViewController
-(void) viewDidLoad {
-(IBAction)play { Here i get error Expected expression.
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"app3", CFSTR
("m4a"), NULL);
UInt32 (soundID);
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
[super viewDidLoad];
}
-(IBAction)Facebook {
[[UIApplication sharedApplication]
openURL: [NSURL URLWithString:@"http://www.facebook.com/synicapps?fref=ts]"]];
}
@end