Hallo miteinander
Habe eine kleine Schwierigkeit entdeckt.
Und zwar habe ich in meinem Settings.Bundle ChildPanes in denen Switches mit DefaulValue YES sind.
Wenn ich nun mein App neu installiere auf dem iPad, werden diese DefaultValues nicht geladen.
Ich muss erst in jedes ChildPane über die Settings einmal gehen, sodass ich die Switches sehe. Dann zurück in mein App und dann werden die Values richtig geladen.
Habe ich irgendwas übersehen, sodass die Settings am Anfang nicht geladen werden, obwohl se default auf YES sind?
So lese ich die Variablen aus den Settings ein:
Alles anzeigen
Wobei die BOOLS seat1Comfort usw aus dem Childpanes zu seat1 usw kommen.
Vielen Danke Klist
Habe eine kleine Schwierigkeit entdeckt.
Und zwar habe ich in meinem Settings.Bundle ChildPanes in denen Switches mit DefaulValue YES sind.
Wenn ich nun mein App neu installiere auf dem iPad, werden diese DefaultValues nicht geladen.
Ich muss erst in jedes ChildPane über die Settings einmal gehen, sodass ich die Switches sehe. Dann zurück in mein App und dann werden die Values richtig geladen.
Habe ich irgendwas übersehen, sodass die Settings am Anfang nicht geladen werden, obwohl se default auf YES sind?
So lese ich die Variablen aus den Settings ein:
Quellcode
- NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
- BOOL *seat1 = (BOOL*)[user boolForKey:@"seat1_switch"];
- BOOL *seat2 = (BOOL*)[user boolForKey:@"seat2_switch"];
- BOOL *seat3 = (BOOL*)[user boolForKey:@"seat3_switch"];
- BOOL *seat4 = (BOOL*)[user boolForKey:@"seat4_switch"];
- BOOL *seat5 = (BOOL*)[user boolForKey:@"seat5_switch"];
- BOOL *seat6 = (BOOL*)[user boolForKey:@"seat6_switch"];
- BOOL *seat7 = (BOOL*)[user boolForKey:@"seat7_switch"];
- BOOL *seat1Comfort = (BOOL*)[user boolForKey:@"switch_comfort1"];
- BOOL *seat1Clima = (BOOL*)[user boolForKey:@"switch_clima1"];
- BOOL *seat1ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange1"];
- BOOL *seat2Clima = (BOOL*)[user boolForKey:@"switch_clima2"];
- BOOL *seat2Comfort = (BOOL*)[user boolForKey:@"switch_comfort2"];
- BOOL *seat2ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange2"];
- BOOL *seat3Clima = (BOOL*)[user boolForKey:@"switch_clima3"];
- BOOL *seat3Comfort = (BOOL*)[user boolForKey:@"switch_comfort3"];
- BOOL *seat3ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange3"];
- BOOL *seat4Clima = (BOOL*)[user boolForKey:@"switch_clima4"];
- BOOL *seat4Comfort = (BOOL*)[user boolForKey:@"switch_comfort4"];
- BOOL *seat4ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange4"];
- BOOL *seat5Clima = (BOOL*)[user boolForKey:@"switch_clima5"];
- BOOL *seat5Comfort = (BOOL*)[user boolForKey:@"switch_comfort5"];
- BOOL *seat5ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange5"];
- BOOL *seat6Clima = (BOOL*)[user boolForKey:@"switch_clima6"];
- BOOL *seat6Comfort = (BOOL*)[user boolForKey:@"switch_comfort6"];
- BOOL *seat6ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange6"];
- BOOL *seat7Clima = (BOOL*)[user boolForKey:@"switch_clima7"];
- BOOL *seat7Comfort = (BOOL*)[user boolForKey:@"switch_comfort7"];
- BOOL *seat7ComfortChange = (BOOL*)[user boolForKey:@"switch_comfortchange7"];
Wobei die BOOLS seat1Comfort usw aus dem Childpanes zu seat1 usw kommen.
Vielen Danke Klist