read old Logging Enabled value from prefs

This commit is contained in:
matthias.ringwald 2012-02-20 20:58:45 +00:00
parent 808722c4b2
commit 8268d6d381

View File

@ -44,6 +44,12 @@
CGRect dummy;
self.loggingSwitch = [[UISwitch alloc] initWithFrame:dummy];
[loggingSwitch addTarget:self action:@selector(loggingSwitchToggled) forControlEvents:UIControlEventValueChanged];
// get old value
Boolean valid;
Boolean loggingOn = CFPreferencesGetAppBooleanValue(CFSTR("Logging"), CFSTR("ch.ringwald.btstack"), &valid);
if (!valid) loggingOn = false;
loggingSwitch.on = loggingOn;
return self;
}