Re: Core Data concurrency during import of folder contents

2015-02-03 Thread Dave Fernandes
NSPersistentDocument is not designed to work with “modern” features like private queue MOCs. So I expect you are going to be playing whack-a-mole if you go this route. I just switched to Mike Abdullah’s BSManagedDocument. It is like UIManagedDocument, but for OS X. If you don’t have any

Re: Core Data concurrency during import of folder contents

2015-02-03 Thread Steve Mills
On Feb 3, 2015, at 06:51:35, Dave Fernandes dave.fernan...@utoronto.ca wrote: NSPersistentDocument is not designed to work with “modern” features like private queue MOCs. So I expect you are going to be playing whack-a-mole if you go this route. I just switched to Mike Abdullah’s

Re: Core Data concurrency during import of folder contents

2015-02-03 Thread Jerry Krinock
On 2015 Feb 03, at 08:02, Steve Mills sjmi...@mac.com wrote: On Feb 3, 2015, at 06:51:35, Dave Fernandes dave.fernan...@utoronto.ca wrote: Mike Abdullah’s BSManagedDocument. Too bad it always saves as a package Actually, that’s an advantage, because flat files do not play well with

Re: Core Data concurrency during import of folder contents

2015-02-02 Thread Steve Mills
On Jan 31, 2015, at 12:00:03, Jerry Krinock je...@ieee.org wrote: I liked this one [1] by Aaron Douglas (all in Swift) when I was needed to do a presentation on Core Data last September. And then, in a rage of NIH [2], I wrote my own [3] instead, in Objective-C. The one Swift

Re: Core Data concurrency during import of folder contents

2015-02-02 Thread Roland King
On 3 Feb 2015, at 04:25, Steve Mills sjmi...@mac.com wrote: On Jan 31, 2015, at 12:00:03, Jerry Krinock je...@ieee.org wrote: I liked this one [1] by Aaron Douglas (all in Swift) when I was needed to do a presentation on Core Data last September. And then, in a rage of NIH [2], I

Re: Core Data concurrency during import of folder contents

2015-02-02 Thread Steve Mills
On Feb 2, 2015, at 17:36:22, Roland King r...@rols.org wrote: get the NSManagedObjectContext the document creates for you with [ super managedObjectContext ], get the store coordinator with [ managedObjectContext persistentStoreCoordinator ], create your own MOCs on that store, hold on to

Re: Core Data concurrency during import of folder contents

2015-01-31 Thread Jerry Krinock
On 2015 Jan 30, at 22:01, Steve Mills sjmi...@mac.com wrote: Isn't there just an example of a document-based app that implement concurrent Core Data importing and all that jazz? I liked this one [1] by Aaron Douglas (all in Swift) when I was needed to do a presentation on Core Data last

Core Data concurrency during import of folder contents

2015-01-30 Thread Steve Mills
I'm trying to learn Core Data. I have a working document model hooked up to a table view (OS X). I have an import method that uses FSDirectoryEnumerator to add an object for each file in the folder. Oky doke! But that blocks for a few seconds while it loops. So I'm trying to make it threaded.

Re: Core Data concurrency during import of folder contents

2015-01-30 Thread Terrence Geernaert
I prefer the GCD method but there are a few details that cause people trouble when combining GCD with CoreData. 1. A named GCD queue may guarantee serial processing but it does not guarantee that it will always use the same thread 2. NSManagedObjectContexts are not thread safe, and it’s not

Re: Core Data concurrency during import of folder contents

2015-01-30 Thread Roland King
On 31 Jan 2015, at 01:20, Steve Mills sjmi...@mac.com wrote: I'm trying to learn Core Data. I have a working document model hooked up to a table view (OS X). I have an import method that uses FSDirectoryEnumerator to add an object for each file in the folder. Oky doke! But that blocks for

Re: Core Data concurrency during import of folder contents

2015-01-30 Thread Steve Mills
Isn't there just an example of a document-based app that implement concurrent Core Data importing and all that jazz? I see tons and tons of little scraps of info and examples (which end up not working with my app as it is because it was written based on Apple's outdated documentation), but not