In my AppDelegate I have this method which will run when the play button is clicked:
- (IBAction)actionPlayTrack:(id)sender {
NSSound *currentSong = [[NSSound alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"03 Bazel" ofType:@"mp3"] byReference:YES];
if([currentSong isPlaying] == NO){
[currentSong play];
} else {
[currentSong stop];
[currentSong release];
}
}
However the if statement to check if the song is currently playing will not work and will always play regardless if there is already a sound playing. Any idea's on why it would be doing this? Perhaps the currentSong object is being reset every time the button is clicked would be my first guess...
[currentSong isPlaying]
Will always return null.