Re: Change font and text color of label which is a static NSTextField
Re: Change font and text color of label which is a static NSTextField
- Subject: Re: Change font and text color of label which is a static NSTextField
- From: Andy Lee <email@hidden>
- Date: Wed, 03 Jun 2009 08:52:35 -0400
On Jun 3, 2009, at 6:25 AM, Shraddha Karwan wrote:
[labelStr setAttributedStringValue:[self setLabelFont:@"Checking for
updates"]];
I suspect labelStr is nil. When are you executing this line? If
labelStr is an outlet and you are doing it in an init method, that is
too early -- labelStr has not been connected yet. Try moving this
line to awakeFromNib.
<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSNibAwaking_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/awakeFromNib
>
In general, when a line of code doesn't seem to be having any effect:
* Make sure the line is actually being executed, using a breakpoint or
NSLog.
* Make sure the receiver isn't nil, using the debugger or NSLog.
* If the receiver is an outlet, make sure you aren't messaging it
before the outlet has been connected.
--Andy
_______________________________________________
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