Commit e6585884 authored by Tobias's avatar Tobias

fix settings multi value alert preferred value if no value is not set in userdefaults

parent c3ecab6f
......@@ -112,7 +112,8 @@
NSUInteger count = [specifier multipleValuesCount];
NSArray *titles = [specifier multipleTitles];
NSUInteger indexOfPreferredAction = [[specifier multipleValues] indexOfObject:[_userDefaults objectForKey:[specifier key]]];
NSValue *currentValue = [_userDefaults objectForKey:[specifier key]] ?: [specifier defaultValue];
NSUInteger indexOfPreferredAction = [[specifier multipleValues] indexOfObject:currentValue];
for (NSUInteger i = 0; i < count; i++) {
id value = [[specifier multipleValues][i] copy];
UIAlertAction *action = [UIAlertAction actionWithTitle:[_settingsReader titleForStringId:titles[i]]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment