Incorrect instance of custom view loading after unarchiving
Incorrect instance of custom view loading after unarchiving
- Subject: Incorrect instance of custom view loading after unarchiving
- From: Sam Krishna <email@hidden>
- Date: Fri, 22 Aug 2008 23:45:49 -0400
Hi all,
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.
Here's a log output describing what I'm talking about:
--------
[Session started at 2008-08-22 22:40:12 -0400.]
2008-08-22 22:40:17.712 OvalFun[55611:10b] In -initWithCoder
2008-08-22 22:40:17.713 OvalFun[55611:10b] self = <MyDocument:
0x16b7a030>
2008-08-22 22:40:17.714 OvalFun[55611:10b] ovalView = <OvalView:
0x16b78c00>
2008-08-22 22:40:17.716 OvalFun[55611:10b] In -initWithFrame
2008-08-22 22:40:17.717 OvalFun[55611:10b] self = <OvalView: 0x16b7b920>
2008-08-22 22:40:17.718 OvalFun[55611:10b] In -
windowControllerDidLoadNib
2008-08-22 22:40:17.718 OvalFun[55611:10b] self = <MyDocument:
0x16b794d0>
2008-08-22 22:40:17.718 OvalFun[55611:10b] ovalView = <OvalView:
0x16b7b920>
2008-08-22 22:40:17.719 OvalFun[55611:10b] About to set MyDocument's
path!
2008-08-22 22:40:17.730 OvalFun[55611:10b] In -drawRect:
2008-08-22 22:40:17.731 OvalFun[55611:10b] Number of objects in [doc
ovals]: 0
--------------------
After I enter MyDocument's -windowControllerDidLoadNib method, it
*looks* as if my OvalView object is completely different from the
OvalView object I unarchived in -initWithCoder.
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?
TIA!
Live Playfully,
Sam
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden