-setCornerRadius not found in user view

I create my own uitableviewcell class, and inside this cell I have a square label. I would like to go around label corners (dateBox) using this:

[dateBox.layer setCornerRadius:4.0f]; [dateBox.layer setMasksToBounds:YES]; 

I do other classes, and it works fine, but for some reason, the warning “setCornerRadius method not found” appears in the uitableviewcell subclass. Does anyone know why this could be?

+8
objective-c iphone cocoa-touch uilabel
source share
1 answer

You need to import QuartzCore and make sure that it is included in your project.

 #import <QuartzCore/QuartzCore.h> 

or

 #import <QuartzCore/CALayer.h> 
+18
source share

All Articles