Re: Disabled controls don't update their visual appearance
Re: Disabled controls don't update their visual appearance
- Subject: Re: Disabled controls don't update their visual appearance
- From: Uli Kusterer <email@hidden>
- Date: Sat, 15 Aug 2009 06:45:24 +0200
On Aug 11, 2009, at 5:45 PM, Christopher Campbell Jensen wrote:
To check when/if any of them were nil, I set a breakpoint and
stepped through the code pausing it each time
"refreshButtonsEnabledState" was called and it made me realise that
the buttons fail to update their state the first time the method
gets called and movieFile is nil. When I, at the end of the movie,
again click on the second tab item, "refreshButtonsEnabledState"
gets called and at this point movieFile is still nil. How come it
works the second time around, and not the first?
Is this an NSDocument-based app? You may want to re-read the
relevant chapter in Hillegass' book: You generally get the "load
document" message before the NIB has been loaded at startup (though
you may also get it afterwards, e.g. when the user chooses the
"revert" menu item). Your code should only load its model into ivars,
and try to update the GUI (if it is there) in *both* the load method
(for the case where it's a revert) and the windowControllerDidLoadNib
method (for the regular "open" case.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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