Question

I have a CoreData database that gets initialized with a local file.
The CoreData schema that looks like this:

Category -->> Objections -->> Responses -->> Evidence  

("-->>" means, has many)

Each entity also has a description that can be anywhere from 2 to thousands of characters long, stored in an NSString.

Question: How can I store this data so that it would be easy for someone to edit without having to know a lot about programming? (But also follow best practices)

Currently, I am thinking of these as possible approaches:

1) Store everything in 1 big plist file. This would be about 25 pages long.
2) Separate each entity into it's own PList file, and relate each the values with an ID#, like a Relational Data Base. This would make the files a more manageable size, but you have to keep track of ID#.
3) Same as above, but with JSON

Was it helpful?

Solution

Create a dead simple desktop application that uses Core Data. Let the people edit the file in that desktop application and keep it stored in Core Data. Then when you ship your application you can embed that SQLite file into your iOS application so there is no start up parsing required.

Standing up an OS X app for this that doesn't need to be pretty is dead simple. Takes an afternoon or two at most and saves you a ton of headaches.

OTHER TIPS

run in simulator, do the parsing of the plist OR CSV (might be easier, since thats an excel compatible format) there (in the simulated app) and then copy the resulting DB to your xcode project and ship it.

=> your 'content provider' can work with excel

=> you don't have to ship a CSV (or whatever file you use) since you have a filled DB after you parsed it in the simulator

There is a nice post from Mattt Thompson about Core Data Libraries & Utilities: http://nshipster.com/core-data-libraries-and-utilities/, maybe something fit for you. =]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top