8

I am making a custom uitableviewcell class and inside this cell I have a square label. I would like to round the corners of the label(dateBox) using this:

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

I do this is other classes and it works fine, but for some reason in the uitableviewcell subclass, I get the warning "setCornerRadius method not found". Does anyone know why this might be?

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
James
  • 2,951
  • 8
  • 41
  • 55

1 Answers1

18

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

#import <QuartzCore/QuartzCore.h>

or

#import <QuartzCore/CALayer.h>
Joe
  • 56,979
  • 9
  • 128
  • 135