I am new to iOS programming and looking for advise for an iPhone app that I am creating.
I have an excel database of about 100 daily tips (which will continue to grow) that I want to import into the app, and have one tip display each day. The user will have access to the current daily tip, plus any prior tips from prior days in the database.
I would like to keep it as a closed app, so if a user feels they want to skip ahead to see new tips by changing their current date – I am not worried about the few who might do that.
From my searches so far, CoreData seems to be the way to go but I was looking for suggestions.
Any help is greatly appreciated.
I’ll try to give you some advice to achieve what you want.
First of all, what do you mean with
I’m not sure about its meaning.
Said this, based on my experience (someone else could give you other advice) I suggest you the following.
About your model you need to create an entity, say
Tip, that could have the following attributes:guid: an identifier that works as an identifier, the type could be a
NSStringcreation date: the creation date for your tip, the type is a
NSDatetext to present: the text to present to the user, the type is a
NSStringIn addition you can also set a title, etc.
The date has two objectives.
First, it allows you to filter tips based on the current date. To filter you need to create a
NSFetchRequestand set aNSPredicate. For example:In addition it allows to sync with your service to download data. Based on the max date you find in the core data sql lite file, you could ask a service (if you use one) to give you the tips that are greater than that date.
The guid allows to have only one tip for that identifier (you could just use the date for that but I think is easier to have a guid, say
12345). This could be useful if you decide to download each time the whole data and you don’t want to insert the same tips. In addition, you don’t want to ricreate the db when you have new tips, but you would add only the new ones. So, you need an identifier that let you to verify if a tip is already there.Finally, about your service (if you want to set up one) you could download data in JSON format. I think it’s simply to set up.
If you are interested, here some links that could make your life easier:
If you want to know something else, let me know.
Hope it helps.