Re: project structure for two-stage core data build
Re: project structure for two-stage core data build
- Subject: Re: project structure for two-stage core data build
- From: "email@hidden" <email@hidden>
- Date: Wed, 27 Jan 2010 20:58:21 +0000
On 27 Jan 2010, at 17:11, Matt Neuburg wrote:
> Here's my problem. Tell me how to structure my project to handle it. The
> issue, in a nutshell, is that my data starts life as text files but in my
> shipping app the data is expressed as a Sqlite database. So there are two
> steps when I build my app:
>
> Step 1:
>
> I have a bunch of text files. I read them and parse them into a Core Data
> in-memory store. Then I switch the store to a Sqlite store and save out the
> database.
>
> Step 2:
>
> I build my real app. It contains the database - not the text files - and
> uses pure normal Core Data Sqlite store procedures.
>
> The way that I originally solved this problem works but isn't easily
> maintainable. I didn't quite know where I was heading with this, so I didn't
> plan very cleverly. I have just one target. What I did involved building and
> running my single target twice, with adjustments to the code and the target
> structure in between.
>
> So, the first time, the text files were included in the target; I build and
> run the app, the app starts up, reads the text files from inside its own
> bundle, saves the Sqlite database, and quits. Then I remove the text files
> from the target, add the database to the target, comment out a bunch of
> code, uncomment some other code, and now we've got the target for the "real"
> app that I ship.
>
> So my real app depends upon a sort of "pre-app" that must not only be built
> but must actually be *executed* in order to generate the database as an
> intermediate product. How should I express this entire two-step dance as a
> single build operation? Thx - m.
>
Would it be possible to make the app simply modify its own structure at run time?
1. build larval app containing text files in bundle.
2. run larval app.
3. larval app looks at bundle, sees text files, generates CD store and deletes text files in bundle.
4. on next run app appears in CD capable adult shipping form.
This might entail leaving some of the larval code in the code base unless it was implemented as a loadable bundle.
Load the larval code bundle, do larval stuff, then delete both the text files and the loadable bundle.
Regards
Jonathan Mitchell
Developer
http://www.mugginsoft.com
Regards
Jonathan Mitchell
Developer
http://www.mugginsoft.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden