calling setBackgroundColor on UILabel causes crash <p>Okay so I have been pulling my hair out, TRYING to find the cause of this problem in my code, and I've narrowed it down to a single line. The problem is, it doesn't make any sense. I create a UIViewController and put this code in the init method</p> <pre><code>- (id)init { [super init]; [self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; iCodeAppDelegate*appDelegate = [[UIApplication sharedApplication] delegate]; UIWindow*window = appDelegate.window; int headerY = appDelegate.rootNavigator.navigationBar.bounds.size.height;// + [UIApplication sharedApplication].statusBarFrame.size.height; //project options table int tableOffsetY = 250; UITableView* projectOptions = [[UITableView alloc] initWithFrame:CGRectMake(0, headerY+tableOffsetY, window.bounds.size.width, window.bounds.size.height-(headerY+tableOffsetY)) style:UITableViewStyleGrouped]; projectOptions.delegate = self; projectOptions.dataSource = self; projectOptions.scrollEnabled = NO; [self.view addSubview:projectOptions]; [projectOptions release]; //xcode logo image int centerX = window.bounds.size.width/2; int logoOffsetY = 8; int logoScale = 200; UIImage* xcodeLogo = [UIImage imageNamed:@"Images/xcode_logo.png"]; UIImageView* xcodeLogoView = [[UIImageView alloc] initWithFrame:CGRectMake(centerX-(logoScale/2), headerY+logoOffsetY, logoScale, logoScale)]; [xcodeLogoView setImage:xcodeLogo]; //[xcodeLogoView setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; [self.view addSubview:xcodeLogoView]; [xcodeLogo release]; [xcodeLogoView release]; //"Welcome to Minicode" text int welcomeLabelHeight = 50; UILabel*welcomeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, headerY+logoScale+8, window.bounds.size.width, welcomeLabelHeight)]; [welcomeLabel setText:@"Welcome to miniCode"]; [welcomeLabel setTextColor:[UIColor darkGrayColor]]; [welcomeLabel setTextAlignment:UITextAlignmentCenter]; [welcomeLabel setBackgroundColor:[UIColor clearColor]]; [welcomeLabel setFont:[UIFont fontWithName: @"Trebuchet MS" size: 24.0f]]; [self.view addSubview:welcomeLabel]; [welcomeLabel release]; return self; } </code></pre> <p>The problem lies in this specific line:</p> <pre><code>[welcomeLabel setBackgroundColor:[UIColor clearColor]]; </code></pre> <p>if I comment it out, the code works fine, except that the label has a big white box behind it. I've scoured the internet, and it appears only one person has had a similar problem. <a href="http://stackoverflow.com/questions/6625822/setting-uilabel-background-color-causes-app-to-crash">The solution doesn't seem to have any sort of application to my code, however.</a></p>