NSArray sorting doesn't work
===

I'm using this code in order to sort a NSArray with custom objects:

    usersData = [[arrayToSort sortedArrayUsingDescriptors:
                              [NSArray arrayWithObjects:
                               [NSSortDescriptor sortDescriptorWithKey:@"distance" ascending:NO],
                               nil]] sortedArrayUsingComparator:(NSComparator)^(id a, id b) {
                                  if ([(UserInfo*)a unreadMsg] > 0)
                                      return  a;
                                  else if ([(UserInfo*)b unreadMsg] > 0)
                                      return  b;
                                  else
                                      return a;}];

What this do is:

 1. Sort the array of my custom objects by "distance" property (unsigned long long)

 2. Sort the array of my custom objects comparing "unreadMsg" property

What happen is that, with the same array in input, sometimes the sorting by "distance" works correctly descending, sometimes ascending.
Can somebody help me?