mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-27 06:35:20 +00:00
read old Logging Enabled value from prefs
This commit is contained in:
parent
808722c4b2
commit
8268d6d381
@ -44,6 +44,12 @@
|
|||||||
CGRect dummy;
|
CGRect dummy;
|
||||||
self.loggingSwitch = [[UISwitch alloc] initWithFrame:dummy];
|
self.loggingSwitch = [[UISwitch alloc] initWithFrame:dummy];
|
||||||
[loggingSwitch addTarget:self action:@selector(loggingSwitchToggled) forControlEvents:UIControlEventValueChanged];
|
[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;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user