Question

I'm currently developing a tour application that will be storing and displaying information about different sights and sculptures, and I'm investigating the different options to store the information.

  • All of the content will be generated before runtime, and nothing will be generated at runtime.
  • I'm looking for a convenient way to write/generate it, such as fetching the information from a spreadsheet. I was therefore considering xml and csv, sqlite, core-data, or archiving.
  • The content to be stored will be custom subclasses of NSObject, such as a Tour class (NSObject subclass), with instance variables such as an NSArray of Sights (NSObject subclass) to view, and a *tourName (NSString).
  • I currently define the content in the - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil method of my main view controller, but I'm certain it's not the most efficient way.

Any suggestion is welcome, as well as its advantages and disadvantages. Also, Core-Data seemed like the best option, but it seemed to me that the data could only be generated programmatically at runtime. Or is there any way to generate instances of entities in Core-Data before run-time?

Thank you.

Était-ce utile?

La solution

You can generate the CoreData database on your mac easily enough. You can write a native app to manage the database yourself, or keep the raw data in any other format (CSV, JSON, etc) and convert that to CoreData.

In any event, you then just create the CoreData database, and include it with your application bundle. When you create the CoreData stack in your app, set the read-only option on the persistent store, and you should be good to go.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top