How to properly sort rows in UITableView by value of a cell's subview (custom added label)?
How to properly sort rows in UITableView by value of a cell's subview (custom added label)? I thought I would find the answer on stackoverflow, but I can't. Am I missing something?
I have a tableView which uses an xml (plist) file as a data source. Every tableView cell also has an added label which shows the distance from current to some other location and I just want to sort the rows by using that distance (this value is开发者_如何学Pythonn't saved in plist file, it is calculated in realtime). I just want to know the theory behind this. Do I need to write the distance in plist file, put the data from plist in array and sort that array? Can I sort the rows somehow directly in tableView, in realtime?
I didn't find any alternative way, I had to save the distance value inside the plist/array and then sort the array.
精彩评论