I have a table view and I would like the cells to have alternative colors, so I found this code:
if ((indexPath.row % 2) == 0) cell.backgroundColor = [UIColor greyColor]; else cell.backgroundColor = [UIColor whiteColor];
It compiles correctly, but when I run the application, I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor greyColor]: unrecognized selector sent to class 0xfbad60'
I usually program in android, so I thought some colors were defined by default, but it doesn't seem to be that way. I'm really new to this, how do I define some colors, for example, black = "000000"? Is there a lesson about this? I looked around, but could not find anything.
Thks
source share