Welcome to the Treehouse Community
Looking to learn something new?
Genevieve Tan4,257 Points
Unable to use UIColororangeColor
I keep getting an compiling error called Use of undeclared identifier 'UIColororangeColor"
I followed what paean typed in the video. Why is it not working for me ? :(
Please advise me on what i should do.
How do i access default colours such as red orange , blue, yellow etc.
This is my code :
self.view.backgroundColor = [UIColororangeColor] ;
Genevieve, I reviewed your code and it seems to me that your code does successfully change the background color to the default orange color.
self.view.backgroundColor = [UIColor orangeColor];
You can access all default colors with UIColor (redColor, grayColor). You can make custom colors with rgb values using UIColor's method shown here:
self.view.backgroundColor = [UIColor colorWithRed:100 / 255.0 green:100 / 255.0 blue:100 / 255.0 alpha:1];
The above code will create a gray color. Since 255.0 is the greatest number for red, green and blue, you need to divide it by 255.0 to get a percent out of 1.
If you have any questions, feel free to ask!
Roberto AlicataCourses Plus Student 39,959 Points
You wrote [UIColororangeColor] instead of [UIColor orangeColor]