Try to add the UITapGestureRecogniser
to the main view which would probably be self.view
, or whatever you have named it.
make sure that user interaction is enabled, and create a selector that will play the sound every time it gets called.
this article might help you, I haven't tried it, but it looks like it going in the right direction.
I would add the UIGesture programatically though.
--This is how you crate a UITapGesture
//this stuff goes in your viewDidLoad for example
UITapGestureRecognizer* singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doSthCool:)];
singleTap.numberOfTapsRequired = 1;
singleTap.numberOfTouchesRequired = 1;
[self addGestureRecognizer: singleTap]; //self or wherever you want to add it
.....
.....
- (void) doSthCool: (UITapGestureRecognizer *)recognizer{
//Code to handle the gesture
NSLog(@"flap");
}
Also, when trying to use a URL don't us CFURLRef if you don't know what its doing, instead try something like this:
NSURL *path = [NSURL URLWithString:@"whatever the url/path is."];
I do suggest that you google some stuff when you get stuck, it's the best way to learn :)
good luck mate!
and have fun coding :)