I am trying to make a simple soundboard app for the iphone, but have come across some troubles including implicit definition of function '...' is invalid in C99
, about a few different functions.
My .h file looks like this:
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
@interface ViewController : UIViewController
{
}
- (IBAction) Jesus: (id) sender;
@end
and my .m file code looks like this:
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction) NamedAction:(id)sender: (id) sender
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Jesus",
CSFTR("WAV") NULL);
if (soundFileURLRef) {
CFStringRef url = CFURLGetString(soundFileURLRef);
NSLog(@"string for URl is %@", (__bridge NSString *) url);
}
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
@end
The error message I'm getting is:
Called object type 'int' is not a function or function pointer