diff --git a/examples/objc/AppRTCMobile/ARDSettingsModel.m b/examples/objc/AppRTCMobile/ARDSettingsModel.m index ecd6111a8b..34a47a4989 100644 --- a/examples/objc/AppRTCMobile/ARDSettingsModel.m +++ b/examples/objc/AppRTCMobile/ARDSettingsModel.m @@ -39,7 +39,11 @@ NS_ASSUME_NONNULL_BEGIN NSArray *> *sortedResolutions = [[resolutions allObjects] sortedArrayUsingComparator:^NSComparisonResult( NSArray *obj1, NSArray *obj2) { - return obj1.firstObject > obj2.firstObject; + NSComparisonResult cmp = [obj1.firstObject compare:obj2.firstObject]; + if (cmp != NSOrderedSame) { + return cmp; + } + return [obj1.lastObject compare:obj2.lastObject]; }]; NSMutableArray *resolutionStrings = [[NSMutableArray alloc] init];