No '-setBorderColor:' found at UIView level?

I have the following code in two different classes (both subclasses of UIView). In one place, it works great, the border is drawn. Elsewhere, I get warnings about methods that are not found, and of course, the border fails. How is this possible?

UIView* test = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100,100)]; test.backgroundColor = [UIColor redColor]; [test.layer setBorderColor: [[UIColor blueColor] CGColor]]; //no '-setBorderColor:' method found [test.layer setBorderWidth: 1.0]; //no '-setBorderWidth:' method found [self addSubview:test]; 
+8
ios objective-c core-animation uiview
source share
1 answer

Make sure that #import <QuartzCore/QuartzCore.h> is at the top of the file. That all CoreAnimation classes are defined.

+20
source share

All Articles