I have a class with a contructor that with NSOrdered set as param, my secondary contructor will receive a collection and a comparator. I am not able to initiale NSOrdered as no contructors exists that converts array to NSOrderedSet
class IOSSortedSet<T>(private val list: NSOrderedSet) : SortedSet<T> {
constructor(
comparator: Comparator<in T>,
collection: Iterable<T>
) : this(NSOrderedSet(collection.sortedWith(comparator).toList())). //Incorrect
Basically the line NSOrderedSet(collection.sortedWith(comparator).toList()) is incorrect. Please help me with the correct syntax.




