• 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: Change font and text color of label which is a static NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Shraddha Karwan <email@hidden>
  • Date: Wed, 3 Jun 2009 18:33:18 +0530

Thank You Andy. That was the cause.
Changed the location of the statement from init to awakeFromnib and its
working.


On Wed, Jun 3, 2009 at 6:22 PM, Andy Lee <email@hidden> wrote:

> 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
>
>
>

--
Regards,
Shraddha Karwan
_______________________________________________

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

References: 
 >Change font and text color of label which is a static NSTextField (From: Shraddha Karwan <email@hidden>)
 >Re: Change font and text color of label which is a static NSTextField (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Change font and text color of label which is a static NSTextField
  • Next by Date: Image (or view ?) not scaling with window
  • Previous by thread: Re: Change font and text color of label which is a static NSTextField
  • Next by thread: Image (or view ?) not scaling with window
  • Index(es):
    • Date
    • Thread