Thursday, November 25, 2010

Accessing Unknown 'cornerRadius' Component of a Property

Wanted to create rounded corners for a component, done this before in another project. Suddenly it doesn't work any more:
button.layer.cornerRadius = 8.0f;
Forgot to include header:
#import <QuartzCore/QuartzCore.h>
Error code kind of hinted in that direction, I guess... Wasn't very obvious. Btw check that CoreGraphics.framework is already included in project.

1 comment:

  1. Thanks for the post. I should have realized what was wrong quicker, but I this exact problem and in baffled me for a few minutes.

    ReplyDelete