summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2018-08-20 11:05:44 -0400
committerNicoleYarroch <nicole@livio.io>2018-08-20 11:05:44 -0400
commit7bc19eea7b21e4dcd1851c3743fc9a7ba0e30024 (patch)
tree57d0f5aa01f58ad37fcdcdb3a1baaf064535ddee
parente41c378339187a68623adc68c89c36124194b47f (diff)
downloadsdl_ios-feature/issue_943_choice_vr_optional.tar.gz
Fixed error log messages for `SDLChoiceSet`feature/issue_943_choice_vr_optional
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/SDLChoiceSet.m12
1 files changed, 9 insertions, 3 deletions
diff --git a/SmartDeviceLink/SDLChoiceSet.m b/SmartDeviceLink/SDLChoiceSet.m
index 7b8822ddb..20d261258 100644
--- a/SmartDeviceLink/SDLChoiceSet.m
+++ b/SmartDeviceLink/SDLChoiceSet.m
@@ -76,9 +76,15 @@ static SDLChoiceSetLayout _defaultLayout = SDLChoiceSetLayoutList;
SDLLogE(@"Attempted to create a choice set with duplicate cell text. Cell text must be unique. The choice set will not be set.");
return nil;
}
- if ((choiceSetWithVoiceCommandCount > 0 && choiceSetWithVoiceCommandCount < choices.count)
- || (allMenuVoiceCommands.count < allVoiceCommandsCount)) {
- SDLLogE(@"If using voice recognition commands, all of the choice set cells must have unique VR commands. There are %lu unique VR commands and %lu choice set items. The choice set will not be set.", (unsigned long)allMenuVoiceCommands.count, (unsigned long)choiceSetWithVoiceCommandCount);
+
+ // All or none of the choices must have VR commands
+ if ((choiceSetWithVoiceCommandCount > 0 && choiceSetWithVoiceCommandCount < choices.count)) {
+ SDLLogE(@"If using voice recognition commands, all of the choice set cells must have unique VR commands. There are %lu unique VR commands and %lu choice set items. The choice set will not be set.", (unsigned long)choiceSetWithVoiceCommandCount, (unsigned long)choices.count);
+ return nil;
+ }
+ // All the VR commands must be unique
+ if (allMenuVoiceCommands.count < allVoiceCommandsCount) {
+ SDLLogE(@"If using voice recognition commands, all VR commands must be unique. There are %lu unique VR commands and %lu VR commands. The choice set will not be set.", (unsigned long)allMenuVoiceCommands.count, (unsigned long)allVoiceCommandsCount);
return nil;
}