-
Notifications
You must be signed in to change notification settings - Fork 27
Sorting by distance #106
Comments
Hi @dneykov, Doesn't seem that transient properties are supported for Core Data sort descriptors. |
I was wondering if its possible some how to sort all objects using sort() function on dataSource.all() |
you can use the sortDescriptor for distance but it means you will need a distance attribute that gets updated every time your current location changes. |
Can I sort it in memory after it's fetched from CoreData? I'm trying something like that but is not working:
|
@dneykov I don't think NSFetchedResultsController works with in-memory data, you need to store it in disk. |
@3lvis I took your advise to update distance attribute. Every time before segue to that list view i'm updating distance attribute with last know location and it works perfectly. Thanks |
Hi,
I'm loading a list of locations in tableView. I have a model with fields "latitude" and "longitude" and I want to sort this list by distance using my current location. How can I sort dataSource?
Thanks.
The text was updated successfully, but these errors were encountered: