off a sound effect with NSUserDefaults

Posted by Momeks on Stack Overflow See other posts from Stack Overflow or by Momeks
Published on 2010-03-31T17:00:39Z Indexed on 2010/03/31 17:03 UTC
Read the original article Hit count: 333

Filed under:
|

i try to off a sound effect on my app

play method is [myMusic play]; ' BOOL soundIsOff = [defaults boolForKey:@"sound_off"]; //the problem is here //xcode compiler doesn't copile this code

 [myMusic play] = soundIsOff;

sound code :

///sound effect ', NSString * musicSonati = [[NSBundle mainBundle] pathForResource:@"sound" ofType:@"wav"]; myMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:musicSonati] error:NULL]; myMusic.delegate = self; myMusic.numberOfLoops = 0;

© Stack Overflow or respective owner

Related posts about iphone

Related posts about SDK