in my nib, i have a view called "fader". in the nib, it's set with a background color of red. however, when i start the app, i want "fader" to have a yellow background
it is my understanding, that this method is the initializer of the nib file. so if i want to change the background color before the nib shows up on screen, this is the place to do it. but it doesn't work
this works.
Confusing! since viewDidLoad works to set my objects in certain ways (after the nib is loaded), i don't understand what "The designated initializer" is used for... does not setting a background color fit into "setup that is required before the view is loaded."?
Code:
[COLOR="Green"]// The designated initializer.
//Override to perform setup that is required before the view is loaded.[/COLOR]
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
{
fader.backgroundColor = [UIColor yellowColor];
}
return self;
}
it is my understanding, that this method is the initializer of the nib file. so if i want to change the background color before the nib shows up on screen, this is the place to do it. but it doesn't work
Code:
- (void)viewDidLoad
{
fader.backgroundColor = [UIColor yellowColor];
[super viewDidLoad];
}
this works.
Confusing! since viewDidLoad works to set my objects in certain ways (after the nib is loaded), i don't understand what "The designated initializer" is used for... does not setting a background color fit into "setup that is required before the view is loaded."?