On Aug 22, 2008, at 20:45, Sam Krishna wrote:

OK, I've read all the email from the past month about Aaron's challenge in Ch. 18 of Cocoa Programming. I've got a custom view (OvalView) where the magic happens. I've got Undo working, but I can't get the app to load a saved document b/c it keeps loading the wrong instance of OvalView on unarchiving.

[snip]

Here's my Q: What do I need to do to fix it? Is there some simple IB3 gestalt that I'm missing? Some NSCoding voodoo that's completely obvious? what gives?

Well, if it was completely obvious, you wouldn't have missed it. ;)

What you're doing wrong is archiving your view (something that *draws* an oval). What you really need to do is archive your data model (something that *describes* an oval). That means you should keep the oval description separate from the view, and let the view refer to the separate description for the parameters it needs to draw the oval.

Write on the blackboard 100 times:

        MVC
        MVC
        MVC
        ...

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to