i have a button
---
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(playSound) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Button x" forState:UIControlStateNormal];
button.frame = CGRectMake(100.0, 100.0, 120.0, 50.0);
[self.view addSubview:button];
-----
and
-----------
- (void)playSound
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"Tink.caf" ofType:@"caf"];
AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath

ath] error:nil];
newPlayer.delegate = self;
newPlayer.volume = 1;
[newPlayer play];
self.sound1Player = newPlayer;
[newPlayer release];
}
--
after pressing the button:
----
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** Call stack at first throw:
(
0 CoreFoundation 0x3537864f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x36306c5d objc_exception_throw + 24
2 CoreFoundation 0x35378491 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x353784cb +[NSException raise:format:] + 34
4 Foundation 0x312e718f -[NSURL(NSURL) initFileURLWithPath:] + 70
5 Foundation 0x312e712f +[NSURL(NSURL) fileURLWithPath:] + 30
6 IBODY 0x00004f63 -[IBODYViewController playSound] + 134
7 CoreFoundation 0x352e8571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
8 UIKit 0x365fcec9 -[UIApplication sendAction:to:from:forEvent:] + 84
9 UIKit 0x365fce69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
10 UIKit 0x365fce3b -[UIControl sendAction:to:forEvent:] + 38
11 UIKit 0x365fcb8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
12 UIKit 0x365fd423 -[UIControl touchesEnded:withEvent:] + 342
13 UIKit 0x365fbbf5 -[UIWindow _sendTouchesForEvent:] + 368
14 UIKit 0x365fb56f -[UIWindow sendEvent:] + 262
15 UIKit 0x365e4313 -[UIApplication sendEvent:] + 298
16 UIKit 0x365e3c53 _UIApplicationHandleEvent + 5090
17 GraphicsServices 0x35b52e77 PurpleEventCallback + 666
18 CoreFoundation 0x3534fa97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FU NCTION__ + 26
19 CoreFoundation 0x3535183f __CFRunLoopDoSource1 + 166
20 CoreFoundation 0x3535260d __CFRunLoopRun + 520
21 CoreFoundation 0x352e2ec3 CFRunLoopRunSpecific + 230
22 CoreFoundation 0x352e2dcb CFRunLoopRunInMode + 58
23 GraphicsServices 0x35b5241f GSEventRunModal + 114
24 GraphicsServices 0x35b524cb GSEventRun + 62
25 UIKit 0x3660ed69 -[UIApplication _run] + 404
26 UIKit 0x3660c807 UIApplicationMain + 670
27 IBODY 0x00002587 main + 82
28 IBODY 0x00002530 start + 40
)
terminate called after throwing an instance of 'NSException'
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.4 (8K2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
(gdb)
--
what is going on???