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

iOS

Core Data - going into production stage

Hi! I am building a Core Data app about a list of training courses with authors displayed on a tableview scene. This is one of several scenes on the app, but have a concern about this in particular. 1) first strategy: Let's say I populate the app with a plist file and submit this to the app store. How can I make these records be part of the persistent store(SQLITE) so they be the "default data" whenever a new user download the app from the app store. I know at a development stage, I saved several courses & authors, but those records only exist on my computer database. If i test the app on my phone, the tableview is empty.

2) Correct me i f i'm wrong. The idea of Core Data is to avoid (in a certain way) multiple submissions or keep submitting the code for every change to the app store. Since I can myself (as an admin) do changes on the phone. But that's only for admins. So, once the app is ready in the app store, how do i push new changes to the code? so people can get these new modifications live, in real time?

Thanks for the ideas.

4 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Sounds like you really need to host this data using a service like Parse. Basically you can host all this data on Parse and then download it on the device using their SDK. As and when you modify the data on Parse it gets downloaded to the device. Check out their tutorials: https://parse.com/tutorials

Yes, I am looking at Parse for push notifications, and will consider for your recommendation. On the other hand, can my app use Core Data? I keep learning more and more about it thanks to teamtreehouse and other resources so I am wondering how can go over the development to the production stage.

I know I have a sqlite database saved on my computer and can use it to add more entries, etc. Also, work with the model versions to add more attributes to the current xcdatamodel, but how about pushing real time updates with let's say: JSON and Core Data?

Thanks Amit for your advice.

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

You can certainly use Core Data to store the information on the device. Here's a good tutorial how you can initialize your persistent store with data: http://iphonedevelopment.blogspot.com/2010/08/core-data-starting-data.html

In addition, if you are going to heavily use Core Data then I recommend using Magical Record

I'll check the first link, give MR a try and see how it goes. Will post an update soon.

Thanks for your feedback.