Re: Customize Views Created Within Interface Builder
Re: Customize Views Created Within Interface Builder
- Subject: Re: Customize Views Created Within Interface Builder
- From: Quincey Morris <email@hidden>
- Date: Tue, 29 Mar 2011 20:21:51 -0700
On Mar 29, 2011, at 12:37, Dominic Dauer wrote:
> in IB I placed a horizontal line (NSBox) into my window. Now I want to change the appearance of this line in my code.
> In my delegate class I defined an IBOutlet NSBox *line and linked it in IB with the correspondending horizontal line.
> In the applicationDidFinishLaunching: method I change the border width and color but nothing happens.
> What do I have to do to get access to that line?
You're trying to do this too soon. There's nothing that guarantees the window nib has been loaded at 'applicationDidFinishLaunching:'. The nib file's owner will get an 'awakeFromNib' message after the nib is actually loaded. That's where you would configure items in the nib.
Note that some objects used as nib file owners (window controllers, for example) have an alternate method that you should override instead of 'awakeFromNib' -- it's 'windowDidLoad' in the case of a window controller. You should consult the appropriate class reference to find out if the class has such a method.
_______________________________________________
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