1

I want to create something like a todo or shoppinglist.

  1. I want to save the data in a sqlite3 database - Is that the right idea in Xcode Version 4.6.2 ?
  2. If I create new entry in the list - Is it possible to choose options/ attributes AND is it possible to choose more than one attribute?
  3. is it possible to repeate entries monthy or in other periods?

I found some examples, but they do not have the infos Im searching for...

Any help?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
webschnecke
  • 919
  • 1
  • 8
  • 21

1 Answers1

2

Quick help for finding the right search-keywords:

  1. if you want to use Xcode's built-in capabilities you can use the Core Data framework (which can actually save the data into sqlite, transparently for the programmer) or you can use directly sqlite by using some Objective-C wrapper like eg: FMDB. Core Data tutorial here and here.

  2. It is up to your implementation whether you allow more attribute to be set for a new record entry or not. What I suggest for you to check is the great QuickDialogue project. Using this you can play with your new record to add optional elements if you want to use a navigation controller style for your app. Even you can create your new record's fields using JSON xml file which adds a great flexibility for future enhancements.

  3. Again: it is your app, your implementation decisions. If you want repeating entry then you can choose to have a repeating parameter section in all your new records (as an optional section in your table view) where user can setup the repeating parameters. You have to design the database/object representation for this also. Then you have to manage these records when presenting daily task view or when dealing with task notifications.

Hope it helped a little bit..

nzs
  • 3,252
  • 17
  • 22
  • Hi THX for this tutorials. Question to CoreData. In all tutorial Ive found, the autor said "CoreData is NO database!!!" so I'm unsure if i should youse CoreData or sqlite3 directly - I would like to decide to the "rigth"way ;-) – webschnecke May 14 '13 at 10:26
  • 1
    What you find is true, CoreData is about creating (visually in Xcode) objects with attributes, relations between the objects - the object graph. And using the CoreData framework will help you with really easy coding to add new record to an object, without worrying the management of the linked objects. The "engine" of CoreData will actually can save to sqlite but the good news is that you don't have to deal with it, all the selects and joins. One really detailed comparison (CoreData vs SQLite) here in SO would be this: http://stackoverflow.com/questions/523482/core-data-vs-sqlite-3 – nzs May 14 '13 at 10:45
  • 1
    And from iOS5 CoreData framework supports by default the iCloud sync which you can find beneficial for your todo/shopping list app. – nzs May 14 '13 at 10:49
  • Hmm now Im confused :-( If I want to use iCloud in the future I have to decide to CoreData. But on the other hand sqlite3 is more powerful and a "real" database... hmmm What should I decide for??? – webschnecke May 14 '13 at 12:33
  • 1
    Sorry confusing you.. ;) iCloud offers easy integration with your data (CoreData) but the actual experiences are that iCloud is not as mature as you would require. You can read a lot on this topic like ZDnet: http://www.zdnet.com/developers-give-apple-an-icloud-ultimatum-fix-it-by-june-7000013495/ But you have other options discussed under eg this SO answer: http://stackoverflow.com/questions/14924629/alternatives-to-icloud-core-data-to-sync-data-between-ios-and-os-x If cloud is a must I would go with the native sqlite options. If you need only local data persistance I'd go w. CoreData – nzs May 14 '13 at 12:52
  • thx :-) - at this time Im standing at my starting point in my new projekt, only a scribbled storyboard :-) So Im not sure If I need iCloud in future... But I want to decide for the best structure ... My database will probably have many relationships. The user should get a well filled DB with data and he/she should have the option to save own infos in the table. It would be stupid if I decide this time for the wrong ones and realized it in the next month :-( – webschnecke May 14 '13 at 13:03
  • One of my favourite ToDo app, Things, decided not to use iCloud, instead they use their own servers. Checking other examples might help you decide. I think you can start creating the database structure because you can choose other cloud providers later, like Heroku, Amazon AWS. – nzs May 14 '13 at 14:09