.
Hi,
I am wanting to clean up my viewDidLoad method as I it is growing in number of lines of code and it is getting messy.
Now my UI is build programmatically, because I want to learn that way of doing things.
So I read on this SO Post that I can set the UI items in a seperate -9void) method and then link to that void by using [self method]
Now when I use that way, it does not seem to work for me.
like, if I want to set the back ground color this will work:
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithRed:0.0 green:0.2 blue:0.38 alpha:1.0];
}
but this does not:
- (void)viewDidLoad
{
[super viewDidLoad];
[self backgroundColor];
// Do any additional setup after loading the view.
}
-(void)backgroundColor
{
UIView *backgroundView = [[UIView alloc] init];
backgroundView.backgroundColor = [UIColor colorWithRed:0.0 green:0.2 blue:0.38 alpha:1.0];
}
Am I misunderstanding this??
Thanks in Advance:-)