iOS: What are the Advantages / Disadvantages of using plist or SQLite, as the data source

StackOverflow https://stackoverflow.com/questions/21155755

  •  28-09-2022
  •  | 
  •  

Question

I am new to cObject or App world, I'm about to make an app where I need to store some information on some players (football), but I do not know where to store them and will hear what you think is best ?

I need to store data like name, age, etc.. I know how I'm doing some text boxes so I can enter the data, but do not know where to save it, I can read that I can use the plist and SQLite, so my quest is if I have about 16-20 names and should only used em on the device where the data have been saved and where I can edit and deleted them, what would you recommend to use as a data source ! or would you recommend another approach ?

Im coding in Xcode atm.

Was it helpful?

Solution

I would suggest you to use CoreDataModel. CoreDataModel is a data storage model for Objective C. It's the way faster then SQL databases and similar to in terms of creating tables, making table connections. You can find more information in Ray Wenderlich's Tutorial.

Since you data model would include many attributes (name, age, etc.), or even relational models I would not suggest using plists in your case.

OTHER TIPS

you can use NSUserDefaults if the data you want to store is very small. Lets say you have an array of users

NSArray *users = ,,,,,;

to save it

[[NSUSerDefaults standardUserDefaults] setObject:users forKey:@"myKey"];

For later to get users data,

NSARray *users = [[NSUSerDefaults standardUserDefaults] objectForKey:@"myKey"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top