• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Disabled controls don't update their visual appearance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disabled controls don't update their visual appearance


  • Subject: Re: Disabled controls don't update their visual appearance
  • From: Christopher Campbell Jensen <email@hidden>
  • Date: Tue, 11 Aug 2009 17:45:24 +0200

On 11 Aug 2009, at 08:00, Uli Kusterer wrote:

On Aug 10, 2009, at 6:04 PM, Christopher Campbell Jensen wrote:
I am sure I am just missing a single line of code, but I can't understand the following behavior:
This code is where the issue occours:
- (void)refreshButtonsEnabledState
{
NSLog(@"%d", [[[tabView selectedTabViewItem] label] isEqualToString:@"Current/Custom"] && [movieFile.movieMetaData isCreated]);
[toggleWriteCheckMarksButton setEnabled:[[[tabView selectedTabViewItem] label] isEqualToString:@"Current/Custom"] && [movieFile.movieMetaData isCreated]];
[resetMetaDataButton setEnabled:[movieFile.movieMetaData isCreated]];
}

I presume tabView, movieFile, toggleWriteCheckMarksButton and resetMetaDataButton are instance variables, and most of them are outlets. Is any of them perhaps NIL at the point where your code fails?


Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de

You are right, they are all instance variables and IBOutlets. movieFile is nil at the point where the buttons fail to respond to the change, but doesn't sending a message to nil return nil (ie false)? 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?


Cheers,
Chris
_______________________________________________

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


  • Follow-Ups:
    • Re: Disabled controls don't update their visual appearance
      • From: Uli Kusterer <email@hidden>
References: 
 >Disabled controls don't update their visual appearance (From: Christopher Campbell Jensen <email@hidden>)
 >Re: Disabled controls don't update their visual appearance (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: converting unicode text representation to unichar
  • Next by Date: Re: Color with pattern image
  • Previous by thread: Re: Disabled controls don't update their visual appearance
  • Next by thread: Re: Disabled controls don't update their visual appearance
  • Index(es):
    • Date
    • Thread