Re: UIDocument + NSFileWrapper crashes on opening

2013-06-21 Thread Quincey Morris
On Jun 20, 2013, at 22:05 , Markus Spoettl ms_li...@shiftoption.com wrote: It seems that the default implementation of UIDocument uses an NSFileWrapper initialized with the NSFileWrapperReadingImmediate reading option. When I create a NSFileWrapper not using that option it works, meaning it

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-21 Thread Markus Spoettl
On 6/21/13 8:19 AM, Quincey Morris wrote: What is interesting too is that my application was able to create the whole wrapper structure when it first created the package. It would have required the same amount of memory to hold the wrappers in memory before they get written to the disk by

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-21 Thread Quincey Morris
On Jun 21, 2013, at 03:40 , Markus Spoettl ms_li...@shiftoption.com wrote: can it be that a wrapper which I hold on to from the time I first created it switches it's backing from in-memory to memory mapped disk once it has been saved? There are actually three possible states for a regular

UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
Hello everyone, I have an iOS 6 app that uses UIDocument to implement loading and saving of my app's data. The document data is loaded from and saved to a NSFileWrapper (representing a file package containing many files and folders), handed from and to the document in -loadFromContents:::

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
Seems the log didn't make it in the initial post, not sure why. On 6/20/13 11:01 PM, Markus Spoettl wrote: I'm pasting the console output of a typical session from the time the app is started via Springboard until it crashes/vanishes. Maybe it contains a clue I don't see. Jun 20 20:52:08

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Luke the Hiesterman
Probably exactly as you said. Try overriding -readFromURL:error: to implement incremental reading. Luke On Jun 20, 2013, at 2:01 PM, Markus Spoettl ms_li...@shiftoption.com wrote: Hello everyone, I have an iOS 6 app that uses UIDocument to implement loading and saving of my app's data.

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
On 6/20/13 11:16 PM, Luke the Hiesterman wrote: Probably exactly as you said. Try overriding -readFromURL:error: to implement incremental reading. OK, but isn't NSFileWrapper supposed to facilitate exactly that by providing sub-wrappers instead of actual data of contained files/folders,

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Quincey Morris
On Jun 20, 2013, at 14:37 , Markus Spoettl ms_li...@shiftoption.com wrote: OK, but isn't NSFileWrapper supposed to facilitate exactly that by providing sub-wrappers instead of actual data of contained files/folders, which can be read on demand when needed? No, NSFileWrapper provides *lazy*

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Luke the Hiesterman
By default, UIDocument does eager reading. You can override that in -readFromURL:error:. Luke On Jun 20, 2013, at 2:37 PM, Markus Spoettl ms_li...@shiftoption.com wrote: On 6/20/13 11:16 PM, Luke the Hiesterman wrote: Probably exactly as you said. Try overriding -readFromURL:error: to

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
You just saved me days of work. Thanks very much! Regards Markus On 6/20/13 11:52 PM, Luke the Hiesterman wrote: By default, UIDocument does eager reading. You can override that in -readFromURL:error:. Luke On Jun 20, 2013, at 2:37 PM, Markus Spoettl ms_li...@shiftoption.com wrote: On

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
On 6/20/13 11:52 PM, Quincey Morris wrote: OK, but isn't NSFileWrapper supposed to facilitate exactly that by providing sub-wrappers instead of actual data of contained files/folders, which can be read on demand when needed? No, NSFileWrapper provides *lazy* loading, in the sense that you