restoreStateWithCoder: not called reliably

Hi there -


in my document based app I'm attempting to restore state of various views.


The views all have a valid identifier and implement


- (void)encodeRestorableStateWithCoder:(NSCoder *)coder

- (void)restoreStateWithCoder:(NSCoder *)coder


After calling invalidateRestorableState: at appropriate times I can see that (eventually) the state is encoded.


However, restoring the state when relaunching the app is very unreliable - it works maybe 1 out of 3 times.

restoreStateWithCoder: is simply not called on the views.


Any ideas whats going on?

Is state restoration that buggy (after all that time, i.e. being introduced in 10.5)??


Cheers,

Jay

Oh my. 8 Years later and I am now seeing the same issue:

After making changes to the state of my window, I invoke [self invalidateRestorableState] from my view controller, and yet, when I quit the app soon after (e.g. within a few seconds), the encodeRestorableStateWithCoder handler is not called and then the app restores an older state at the next launch. This is bad.

restoreStateWithCoder: not called reliably
 
 
Q