我有一个非常奇怪的错误,这是我的代码片段:
- (void) drawRect:(CGRect)rect{
CGRect fr = rect;
fr.size.width = fr.size.width-2*rad;
fr.size.height = fr.size.height-1;
fr.origin.x = rad;
// draw round corners layer
bglayer = [CALayer layer];
bglayer.borderWidth = 1;
bglayer.borderColor = [UIColor blackColor].CGColor; // Here I receive Error: Expected identifier before '[' token
bglayer.backgroundColor = bgColor.CGColor;
bglayer.cornerRadius = rad;
bglayer.frame = fr;
bglayer.zPosition = -5; // important, otherwise delete button does not fire / is covered
[self.layer addSublayer:bglayer];
......
.....
}
在哪里:bglayer.borderColor = [UIColor blackColor].CGColor;
我收到此错误:
' ['之前的预期标识符令牌
请有人帮助我:)