Re: CoreData not noticing changes to transformable properties

2010-12-03 Thread Adam Swift
Core data attributes are expected to be immutable and will be treated as such. To property track changes to the value of an attribute you'll need to replace the attribute object on the owning managed object with a different instance. Take a look at the encapsulation section of the model

Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-18 Thread Adam Swift
On Nov 18, 2010, at 6:17 AM, Jerry Krinock wrote: On 2010 Nov 16, at 16:51, Quincey Morris wrote: 2. If you have a *custom* NSManagedObject subclass (i.e. whose subclass name is known to the Core Data entity), you can of course override the Core-Data-supplied accessor methods by

Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Adam Swift
On Nov 12, 2010, at 10:51 AM, Jerry Krinock wrote: When implementing this method: -createDestinationInstancesForSourceInstance:entityMapping:manager:error: in a subclass of NSEntityMigrationPolicy, one typically loops through attributes of the given source instance, does whatever

Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Adam Swift
And now with functional links... sigh On Nov 12, 2010, at 10:51 AM, Jerry Krinock wrote: When implementing this method: -createDestinationInstancesForSourceInstance:entityMapping:manager:error: in a subclass of NSEntityMigrationPolicy, one typically loops through attributes of the

Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Adam Swift
On Nov 16, 2010, at 10:46 AM, Jerry Krinock wrote: On 2010 Nov 16, at 09:48, Adam Swift wrote: That the objects will be fetched as NSManagedObjects is documented in the versioning migration guide … Three-Stage Migration. Thank you, Adam. I see that it says the class of all entities

Re: Setting (not saving) NSPersistentDocument Metadata changes file Modification Date

2010-11-07 Thread Adam Swift
On Nov 6, 2010, at 1:40 PM, Sean McBride wrote: On Thu, 4 Nov 2010 21:53:28 -0700, Adam Swift said: The NSPersistentStoreCoordinator class method works directly with the file at the specified URL and so writes the metadata to the the file immediately. I guess you're referring to PSC's

Re: Setting (not saving) NSPersistentDocument Metadata changes file Modification Date

2010-11-04 Thread Adam Swift
The NSPersistentStoreCoordinator class method works directly with the file at the specified URL and so writes the metadata to the the file immediately. To modify the metadata on the store without saving automatically you need to use the store instance's setMetadata: method. You can access the

Re: Core Data migration from xml to sqlite

2009-09-02 Thread Adam Swift
On Sep 2, 2009, at 4:51 AM, Ian Kennedy wrote: Hi all, How would I go about doing a one-time migration of application data from an xml persistent store to a sqlite persistent store? i.e. the model stays the same, the data is migrated, and the app uses the sqlite store from there on out.

Re: Core Data completely unable to find the source object model for migration

2009-08-07 Thread Adam Swift
On Aug 7, 2009, at 8:39 AM, Matteo Manferdini wrote: This can happen as a side effect of the old template code that merges a model using all managed object models from the application resources as well as all frameworks linked into the application. Thank you Adam, this is exactly the

Re: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Adam Swift
On Aug 6, 2009, at 10:37 AM, Matteo Manferdini wrote: To further investigate the matter, I logged the contents of both the NSStoreModelVersionHashesKey dictionary from my store metadata and the dictionary returned by the entityVersionHashesByName: method of my source model. I did this both for

Re: CoreData deleteAll of kind

2009-07-07 Thread Adam Swift
On Jul 7, 2009, at 9:17 AM, Sean McBride wrote: On 7/7/09 1:19 AM, Mike Abdullah said: Thanks all for your feedback. Seems quite inefficient. Wonder if this is filed as a suggestion to Apple. Why should that matter? File a request anyway, it will make the existing request ore prominent.

Re: Two threads, two managed object contexts. Do I need locking?

2009-06-29 Thread Adam Swift
On Jun 29, 2009, at 6:24 AM, Michael Greiner wrote: My application uses a Core Data model on two threads - the main UI thread and a worker thread. Each thread has its own private managed object context as per Apple's recommendation. The managed object contexts share a single persistent

Re: Two threads, two managed object contexts. Do I need locking?

2009-06-29 Thread Adam Swift
On Jun 29, 2009, at 1:18 PM, Adam Swift wrote: No, if the only time/place you access the persistent store coordinator is when you create it and then pass it into [[NSManagedObjectContext alloc] initWithPersistentStoreCoordinator:psc], then you should be fine without any additional

Re: entity name not found when model is in private framework

2009-05-22 Thread Adam Swift
On May 22, 2009, at 1:45 AM, Rick Mann wrote: I'm working on a Framework with a Core Data model. When I first built the test app, I couldn't get the Framework to work right, and so I had all the source files (and .xcdatamodel) included in the test app directly. That worked fine. I've

Re: entity name not found when model is in private framework

2009-05-22 Thread Adam Swift
On May 22, 2009, at 11:40 AM, Rick Mann wrote: On May 22, 2009, at 09:58:15, Adam Swift wrote: On May 22, 2009, at 1:45 AM, Rick Mann wrote: I'm working on a Framework with a Core Data model. When I first built the test app, I couldn't get the Framework to work right, and so I had all

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-08 Thread Adam Swift
On May 8, 2009, at 1:00 PM, Jerry Krinock wrote: Conclusion. Here's what I believe to be the missing documentation... *** You can use -insertObject: to cancel a prior deletion, however if certain operations are performed after the deletion and before the restoring -insertObject:, the

Re: Core Data Migration and the Inexperienced Younger Self

2009-05-07 Thread Adam Swift
On May 7, 2009, at 7:02 AM, I. Savant wrote: On Wed, May 6, 2009 at 6:36 PM, Melissa J. Turner mjtur...@apple.com wrote: Context is important. Also future-proofing. If your app was originally written against v1 CoreData (Tiger), you need to update the app to be wise enough to check the

Re: Core Data Suddenly Losing Changes

2009-04-27 Thread Adam Swift
Is your call to save: the managed object context succeeding? ... what does that managed object context return for hasChanges? ... and are the objects you expect to be saved in the insertedObjects, updatedObjects, deletedObjects collections? ... is save returning an error? And

Re: Core Data Save as versions

2008-09-11 Thread Adam Swift
On Sep 11, 2008, at 2:09 AM, Ken Tabb wrote: Morning folks, I was reading the Core Data version migration documentation, and it seems easy to use (haven't put it into practice yet as I was reading it on a sunbed on hols, and I have enough trouble sneaking programming books into the

Re: Core Data Migration Progress

2008-09-11 Thread Adam Swift
On Sep 11, 2008, at 8:08 AM, Doug Penny wrote: I have a core data store that I am migrating using the default/automatic migration process. It seems to work very smoothly, but takes a minute or two to complete. I would like to provide some type of feedback to the user to let them know what is

Re: Core Data Versioning - more than two versions, how to map upgrades?

2008-08-20 Thread Adam Swift
On Aug 12, 2008, at 7:38 PM, Graham Perks wrote: I have model versions 1, 2, and 3, 3 being the latest. Obviously I need a mapping file to upgrade 2 - 3. But for upgrades of v1, should the mapping file be 1 - 3 direct, or 1 - 2 and Core Data will do a two-step upgrade? Creating a mapping

Re: Core Data merging

2008-08-20 Thread Adam Swift
On Aug 15, 2008, at 5:26 AM, Vadim Lozko wrote: On Aug 15, 2008, at 6:09 AM, Tim Isted wrote: On 15 Aug 2008, at 00:19, Vadim Lozko wrote: I'm having a problem trying to upgrade an existing store of a Core Data database to a newer model that simply has 1 additional attribute property

Re: Counting instances in Core Data

2008-04-29 Thread Adam Swift
On Apr 29, 2008, at 9:03 AM, Steve Cronin wrote: Folks; I want to obtain a count of instances for a specific entity in stored in Core Data (SQLite) In the archive I find this: FROM : mmalcolm crawford DATE : Sun Apr 02 21:21:45 2006 On Apr 2, 2006, at 11:16 AM, Frederick

Re: core data and sqlite db store problem

2008-04-01 Thread Adam Swift
On Mar 31, 2008, at 10:23 AM, Scott Guyer wrote: Thanks Jeff, That would explain it. Crikey...whole lotta Zs in the CD created SQLite schema. :) In XCode, there is an Design - Data Model - Import... menu item. It is looking to import an XML file of a particular format. Any