On Sep 21, 2015, at 14:52 , Marek Hrušovský <xhrus...@gmail.com> wrote:
> 
> Personally I would do it like this:
> 1. Figure out what values you need to store
> 2. Create custom object called configuration; for each window one kind
> 3. Make it conform nscoding and add a delegate property (which will point
> to windowcontroller)
> 3. implement initwithcoder/encodewithcoder
> 3. add this to your model

I agree with your general approach, but I think it needs to be understood that 
the “values you need to store” should be representations of the UI state in 
terms of the data model, not the UI state itself. That is, I think it’s a 
terrible idea to archive window controllers, or scroll offsets, or any view 
geometry like that. You don’t know that you can actually recreate the original 
UI state (for example, you don’t even know you can restore the original window 
sizes, since the display configuration can change at any time).

I also agree with your point that competing with state restoration may not work 
out so well. It should be possible to turn off all manifestations of state 
restoration, but in practice this is another lousy compromise.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to