Re: NSDocument's loadDataRepresentation called before the document UI is functional?
Re: NSDocument's loadDataRepresentation called before the document UI is functional?
- Subject: Re: NSDocument's loadDataRepresentation called before the document UI is functional?
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 12 Aug 2003 11:05:12 +1000
Simply put, any UI-related code in loadDataRepresentation doesn't
have any effect - text views which have their text storage updated
don't reflect the change, tables won't change selected rows, etc etc.
How can I fix/get around this?
-loadDataRepresentation is called before -windowControllerDidLoadNib.
The idea is that in -loadDataRepresentation, you should only deal with
the model, not the view or controller. When
-windowControllerDidLoadNib is called, the model should already be in
place.
The workaround, for anyone interested, is to store the data you receive
in loadDataRepresentation, and only use that data in
windowControllerDidLoadNib.
The problem with this is that it's a pain in the butt, and not
documented either. If I want to set the contents of a few text fields,
I shouldn't need to mirror their contents in my model implementation.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.