I am creating a shooter game. On the Iphone 4 Simulator , the app works just fine. On the actual device, All goes well, until I press the shoot button. Then the app crashes. Here is my code:
Code:
Code:
-(IBAction)Fire {
NSString *path = [[NSBundle mainBundle] pathForResource:@"gunShot" ofType:@"mp3"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
//theAudio.delegate = self;
float effects_Volume = [[NSUserDefaults standardUserDefaults] floatForKey:@"effectsVolume"];
theAudio.volume = effects_Volume;
[theAudio play];
IBOutlet UIImageView *newBullet = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Bullet1.png"]];
newBullet.frame = CGRectMake(0, 0, 10.0, 10.0);
newBullet.center = CGPointMake(239.0, 236.0);
[bulletArray addObject:newBullet];
[self.view addSubview:newBullet];
[newBullet release];
}
Also when I try to play a sound, like in the first part of the code above, it doesent work. I cant hear anything.
Please tell me whats wrong? Thanks a bunch!
The console says: "GDB: Data Formatters temporarily unavailable, will retry after a 'continue'.