I am trying to create a UIButton that has rounded corners, but that I can alter the background color at runtime. Using background images is not an option.
I am using a UIButton set to Custom so that the background color will show (not just the corners) am using the following to set the cornerRadius:
Code:
NSInteger max = [myButtonArray count];
for(int i=0; i<max; i++)
{
UIButton *button = (UIButton *)[myButtonArray objectAtIndex:i];
button.layer.cornerRadius=SMALL_LABEL_CORNER_RADIUS;
}
}
I am getting the error:
"Accessing unknown 'cornerRadius' component of a property
Yet, I know there is a .layer.cornerRadius available as I have used it in the past, within this very iPhone app.
What am I missing here?