Re: Core Data Initialization
Re: Core Data Initialization
- Subject: Re: Core Data Initialization
- From: Jerry Krinock <email@hidden>
- Date: Mon, 02 Sep 2013 07:33:52 -0700
On 2013 Sep 02, at 04:01, Dave <email@hidden> wrote:
> 1. Is this advisable? Is it Safe?
It's kind of weird.
> 2. What happens if I change the model file and forget to update the Pre-built SQLite File?
If your test suite launches the app as a new user, Core Data will either barf in a big way, or maybe try to migrate the store, and it might even succeed. Otherwise, you may get a lot of 1-star reviews. In any case, you don't want this to happen.
> 3. Is there a better way of doing this?
A more design patten I've seen in Apple sample code is to check the store upon opening, and if objects are missing or improper, populate with default objects or whatever in code. This is also more robust in that it may be able to repair a corrupt store in unforeseen edge cases.
* * *
All that being said, there's a lot to say in favor of a working app. If it would require a lot of code to initialize a new store, adding a few checks to your design and test process instead might be advisable.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden