mcdermj / buster

Buster D-Star Reflector Client for MacOS X
Other
15 stars 7 forks source link

Changed storyboard bindings of Audio Preferences tab checkboxes from User Defaults to `AudioViewController` #48

Closed DonaldHays closed 7 years ago

DonaldHays commented 7 years ago

Loading the Audio Preferences tab was resulting in an exception being thrown. I couldn’t figure out exactly what was causing it, except that it was related to the checkbox bindings to User Defaults. I addressed the issue by exposing dynamic properties on BTRAudioViewController for courtesyTone and voiceAnnounceOnStatusChange which reflect the corresponding keys in User Defaults, then changing the checkbox bindings away from User Defaults and to the BTRAudioViewController instance, similar to the bindings for the pop-up buttons. Fixes #43

Also, I weak-ified self in the BTRAudioDeviceChanged notification listener, to avoid that observer registration preventing the BTRAudioViewController instance from deallocating.

mcdermj commented 7 years ago

Good catch on the weak link. The standard in the code for that is to name the variable weakSelf when you're just weakifying a self reference, but that's a nitpick and can get fixed later.

I'd rather use the UserDefaultsController here, but I'm not religious enough about it to want to spend the time running down a solved problem.