Re: [Q] Re: NSPersistentStore -addPersistentStoreWithType
Re: [Q] Re: NSPersistentStore -addPersistentStoreWithType
- Subject: Re: [Q] Re: NSPersistentStore -addPersistentStoreWithType
- From: Volker in Lists <email@hidden>
- Date: Mon, 23 Feb 2009 15:20:14 +0100
Hi,
i am usually happy with the quick check if a file exists and don't
rely on any entity counts within the first view milliseconds of
startup. If you have a fixed location (say URL), the check is really
easy to implement. If you use a document based app, you have more
elegant possibilities, since document creation and document opening
differ in their calls.
Cheers,
Volker
Am 23.02.2009 um 15:01 schrieb Jon C. Munson II:
Namaste!
I'm working on populating some entities with records just after when
the
physical file of the store is created (this would typically happen on
install and generally only once). These records are generally for
application use and won't be managed by the end user.
In my app delegate's class implementation file there's a
-persistentStoreCoordinator method that returns the
persistentStoreCoordinator. As part of functionality therein, it
calls the
-addPersistentStoreWithType method which either returns an instance
of an
existing store or creates a new store and then returns that instance.
Unfortunately, I don't see a way to know if that file was actually
created
during that method call (without checking for a file before the call
to
-addPersistentStoreWithType).
Is there a more elegant way to check whether the store had to create
the
file, etc. (and what is it), or do I need to actually look for it,
etc.,
first?
If the latter, would checking for the file on disk be better than
obtaining
a record count from an entity?
Many thanks in advance!!! :D
Peace, Love, and Light,
/s/ Jon C. Munson II
_______________________________________________
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
_______________________________________________
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