is it possible to sort table columns with items '23:34', '1:21'

Gday

This is no big deal, but comes under the category ‘it would be nice if I could…’

I’ve got three table columns with times shown in the form ‘23:34’ as minutes and seconds.

Trouble is, when sorting, I get a result 1:09,23:34,2:56,3:03,31:45,4:20

Is there any way of sorting these correctly when setting the Sort Key in IB?

Regards

Santa

You’d probably need to store the values as NSDates, and then they’s sort fine. You’d use a date formatter to make just the times appear.

Thanks Shane

What I ended up doing was to place two spaces before each minute value that was less than 10. This had the effect of lining up the colons in each column, and resulted in a correct sort. We’re highly unlikely to get any jobs that take 100 minutes, so for me it works.

Regards

Santa