On Mar 13, 2012, at 2:28 PM, Michael de Haan wrote:

> What I wish to have happen, is a situation where model and view AND last user 
> value saved and restored using the "bindings" model.
> Is this possible?

I'm not really 100% sure what you're after here, so I may be off:

If you literally wanted to do everything with bindings, just bind everything to 
the same source. Bind the model and the controls all to the SUDC, and register 
the factory default value with user defaults so everything is always the value 
you want.

But in that case, what's the point of the model having this attribute at all? 
(Or rather, what's the point of having the model if there's only one of them? 
Assuming that if there are multiples, you definitely wouldn't be storing it in 
user defaults like this.)


If you're binding a bunch of things to a model object and simply want the model 
to persist, then you could store the whole model somewhere (perhaps user 
defaults). Serialize it to a dictionary object or use NSCoding, and save that 
into your persistent store. When the app launches, load it back up.


--
Seth Willits






_______________________________________________

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