Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
edwin lobo
5,888 PointsSaving data from tableview on selection. Ideally need to save data from search results from map
I have a tableview displaying search results of map view. And creates and annotation when selected. i Need to save data on select Which consist of let addressLine = String( format:"%@%@%@%@%@%@%@", // street number selectedItem.subThoroughfare ?? "", firstSpace, // street name selectedItem.thoroughfare ?? "", comma, // city selectedItem.locality ?? "", secondSpace, // state selectedItem.administrativeArea ?? "" )
return addressLine
}
2 Answers
Damien Watson
27,419 PointsYou could save in a few different ways, sorry its been a while since I have
-
Local plist file on device
- This is the way I prefer, but I haven't yet done it in Swift. I found this tutorial which should help:
- pList tutorial
-
Core Data
- This is a localised database where you can store fields.
- core data
-
Create an external database
- This is probably the most complicated, but flexible as it can be reused for android or web. But you have to know php or c#, depending on what database and server side language.
edwin lobo
5,888 PointsThanks a lot for your reply.... We need some good tutorials in IOS using map-kit. i.e. cllocation(distance, Manager), Geofencing. Most of apps use maps. Would be really appreciate if teamtreehouse comes up with these tutorials.
edwin lobo
5,888 PointsIm working on Location based reminder app. -> User searches a map | Search results are displayed on table view (Completed till here) -> I need to save coordinates and use it for geofencing i need some advise on how to save data...
Damien Watson
27,419 PointsDamien Watson
27,419 PointsHey Edwin, I'm not sure what the question is. What data (address data I'm assuming) and where do you want to save it, what do you mean by save, to device or database?
I'm just trying to understand what you're doing and need help with. :)