I need to sort the array of string and want to access viewController
property in the comparator block. So, Planning to pass ViewController
object to comparator block. How to pass parameter to comparator block ?
Here is the Code.
Since comparator logic is lengthy and sorting is used many places, I can't expand comparatorBlock in the declaration.
sortedArray = [NsMutableArray arrayWithArray:[unsortedArray sortedArrayWithOptions:0 usingComparator:comparatorBlock]];