Sort(SortMethod as Delegate)

Does this work in iOS? Or am I doing something wrong?

Wrote a function to help sort an array of classCard using a sort order property of the class

Function CardOrderSort(c1 as classCard, c2 as classCard) as Integer
If c1.pSortOrder > c2.pSortOrder Then Return 1
If c1.pSortOrder < c2.pSortOrder Then Return -1
Return 0
end Function

Try to sort an array of classCard by

pHandS.Sort(AddressOf CardOrderSort)

Get error “This item does not exist”

Looks fine to me. Is CardOrderSort within the scope of the place where you want to use it?

Ulrich,
I am sure you are correct. The issue was scope. Decided to use the SortWith option instead and it works well.