I have some code that sets a border around a UITextView. It builds correctly in one class; when I take that code and copy it to another class (changing the object name), it no longer builds, saying “Property ‘borderWidth’ cannot be found in forward class object ‘CALayer *'” (the same message for the other two lines of code). I have done a clean, re-build and nothing helps. Why is this happening? and how do I fix it?
- (void)viewDidLoad {
[super viewDidLoad];
//-- draw box around notes field
orderNotes.layer.borderWidth = 1.0f;
orderNotes.layer.borderColor = [[UIColor blackColor] CGColor];
orderNotes.layer.cornerRadius = 4;
}
Object “orderNotes” is defined as UITextView. There are no other errors.
You need to:
Otherwise, the
layerproperty is not visible to you.