Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-14 Thread Matt Neuburg
On Mon, 13 Jan 2014 16:21:46 +0100, Markus Spoettl said: >What I want is that iOS saves whenever the app is backgrounded. > >So the questions is: Can I safely call -updateChangeCount: when my app is >being >sent to the background alongside the automatic NSUndoManager change handling? I don't u

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Markus Spoettl
On 1/13/14 9:13 PM, Kyle Sluder wrote: But it's just generally a bad practice to violate the framework's stated assumptions. -updateChangeCount: manages a change counter, not a "force saving" flag. There's a very clear way to implement a "force saving" flag that fits within the framework design.

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Kyle Sluder
On Mon, Jan 13, 2014, at 12:08 PM, Mike Abdullah wrote: > > This does not strike me as a good idea. -updateChangeCount: is a > > counter; adding a place that increments the counter without having a > > corresponding decrement sounds like an invitation for state corruption, > > particularly in the p

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Mike Abdullah
On 13 Jan 2014, at 16:29, Kyle Sluder wrote: > On Mon, Jan 13, 2014, at 07:21 AM, Markus Spoettl wrote: >> Hi, >> >> I have an app that uses UIDocument and NSUndoManager. That way the >> system >> picks up changes to the data and knows when to auto-save. >> >> Some parts of the model are

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Kyle Sluder
On Jan 13, 2014, at 9:24 AM, Markus Spoettl wrote: > >> On 1/13/14 5:29 PM, Kyle Sluder wrote: >> This does not strike me as a good idea. -updateChangeCount: is a >> counter; adding a place that increments the counter without having a >> corresponding decrement sounds like an invitation for state

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Markus Spoettl
On 1/13/14 5:29 PM, Kyle Sluder wrote: This does not strike me as a good idea. -updateChangeCount: is a counter; adding a place that increments the counter without having a corresponding decrement sounds like an invitation for state corruption, particularly in the presence of framework code that

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Kyle Sluder
On Mon, Jan 13, 2014, at 07:21 AM, Markus Spoettl wrote: > Hi, > >I have an app that uses UIDocument and NSUndoManager. That way the >system > picks up changes to the data and knows when to auto-save. > > Some parts of the model are not using the undo manager (mostly settings > where >

Re: Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Mike Abdullah
On 13 Jan 2014, at 15:21, Markus Spoettl wrote: > Hi, > > I have an app that uses UIDocument and NSUndoManager. That way the system > picks up changes to the data and knows when to auto-save. > > Some parts of the model are not using the undo manager (mostly settings where > undo makes no s

Mixing UIDocument's NSUndoManager and -updateChangeCount:

2014-01-13 Thread Markus Spoettl
Hi, I have an app that uses UIDocument and NSUndoManager. That way the system picks up changes to the data and knows when to auto-save. Some parts of the model are not using the undo manager (mostly settings where undo makes no sense or isn't wanted). Still that data is stored alongside the