why can this code not access ‘borderWidth’ (iphone code attached)
This is based on a simple test project, but I did add QuartzCore framework however this didn’t help. Still is throwing the error, see code below. Another project where I do this it works fine and I can’t see the difference
#import "Customview.h"
@implementation Customview
- (id)initWithCoder:(NSCoder *)coder {
self = [super initWithCoder:coder];
if (self) {
// UI Layout
self.layer.borderWidth = 5; // ERROR error: accessing unknown 'borderWidth' component of a property
}
return self;
}
You need to add QuartzCore framework in order to access layer property of any UIView. Did you add that ?
Add Framework from following steps if you are using xCode 4
Now, Import it where ever you want to access layer property of any UIControl.
Hope this help.