0

Really straightforward description of my app; it is a simple app that display for the consumer questions and the user must answer the question I attempted to store the questions on a simple txt file and luckily I got a positive consequences,However I thought perhaps I should come with another way to store my data and I been very curious about using Core Data since it might be better for my app and for me as well since I'll gain more skills and information on iOS programming. To be honest I'm new to the iOS world and never used Core Data before.Yesterday I started studying the library that Apple provides to the public and what I found out that I can't access or add data on my NSManagedObjectcontext unless adding some lines of code such as the insert method and fetching the data. correct me please if what I mentioned earlier was wrong and lastly my question is should I use core data technology on my app? I'll be pleased to get more tips,info and great sources from you world.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Oneill
  • 149
  • 1
  • 8

2 Answers2

1

As a beginner, you'll probably have an easier time with plists than with Core Data (which has some learning curve, and you'll need to write, and understand, some code to make it work).

With plists, you can save an NSArray or an NSDictionary as a file (and read that file when needed). You can also create a plist with some data and include it into your app (e.g. if you have a set of questions you want to include). Check out this tutorial.

Of course, once you need to implement data storage in a real, production app, you need to understand the tradeoffs between all the different persistence mechanisms that iOS provides.

TotoroTotoro
  • 17,524
  • 4
  • 45
  • 76
  • Hello thanks for the tutorial yeah you are pretty right about working plist might be easy for me but would it make sense if I have over 50 questions to write it on plist file? – Oneill Dec 07 '13 at 19:13
  • Yes, that is fine. 50 questions can easily fit into memory, so you should fine. It's a good question to ask though when choosing which storage mechanism to use. – TotoroTotoro Dec 07 '13 at 19:32
1

Core Data can be made more approachable by using a tool such asmogenerator which will help abstract from a lot of the more in-depth stuff. Good stuff for wanting to do things 'right' and to progress your knowledge, but maybe the best way to do this is to keep it simple, get it working and move to something more in-depth if you start hitting walls?

Looks like they are trying to close this so hope this helps

davbryn
  • 7,156
  • 2
  • 24
  • 47