photokandyStudios / gbible

Greek Interlinear Bible for iOS (native)
http://www.photokandy.com/apps/gib
41 stars 31 forks source link

When copying verses, the verse numbers are ordered as strings, not numbers. (Reported by Adam Denoon) #60

Closed kerrishotts closed 11 years ago

kerrishotts commented 11 years ago

Thanks to Adam Denoon for this one.

If you copied verses that had single-digit verse #s and double-digit verse #s, they were in alphabetic, but not number order, as in:

1 10 11 12 2 3

Who knew that was the default order for the NSArray sort methods?

kerrishotts commented 11 years ago

I've changed to using

                                sortedArrayUsingComparator:
                                  ^NSComparisonResult(id obj1, id obj2)
                                  {
                                    int verse1 = [PKBible verseFromString:obj1];
                                    int verse2 = [PKBible verseFromString:obj2];
                                    if (verse1>verse2) { return NSOrderedDescending; }
                                    if (verse1<verse2) { return NSOrderedAscending; }
                                    return NSOrderedSame;
                                  }

This seems to fix the issue for me.

kerrishotts commented 11 years ago

Fixed in latest build (4790)