IAM使用setting.bundle和我嘗試以顯示與開關撥動隱藏圖像,這裏是我的代碼,但我錯過了什麼:和NSUserDefaults的出現畫面
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[//Some code show the hidden pic]; myPic.hidden = NO;
我的關鍵是.eg = wood_back
應我用ObjectForKey
?
//聲音的問題:
現在我嘗試過在我的應用程序的聲音效果
玩兒法是[myMusic play];
BOOL soundIsOff = [defaults boolForKey:@"sound_off"];
//the problem is here :D
//xcode compiler doesn't copile this code
[myMusic play] = soundIsOff
聲代碼:
///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;
謝謝你肯尼。很好用:): - *:-X 你有任何使用Slider切換的教程嗎? :D – Momi 2010-03-30 14:29:02
@Momeks:'doubleForKey:'。 – kennytm 2010-03-30 14:34:15
肯尼我有另一個問題!再次檢查問題! – Momi 2010-03-31 14:17:46