diff --git a/PrefsBundle/BluetoothTableViewAdapter.m b/PrefsBundle/BluetoothTableViewAdapter.m index 7e583040f..d52efa553 100644 --- a/PrefsBundle/BluetoothTableViewAdapter.m +++ b/PrefsBundle/BluetoothTableViewAdapter.m @@ -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; }