我收到此错误消息并匹配我的括号并且找不到任何错误。你能找出问题所在吗?
谢谢你。
错误信息在相关行被注释掉;文件名是 MyHorizLine.m:
#import "MyHorizLine.h"
@implementation MyHorizLine
-(id)initWithCoder:(NSCoder *)decoder
{
self [super initWithCoder:decoder]; //Missing '[' at message send expression
if (self) {
self.backgroundColor = [UIColor clearColor];
}
return self;
}
-(void)drawRect:(CGRect)rect
{
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(c, 0, 0);
CGContextAddLineToPoint(c, self.bounds.size.width, 0);
CGContextStrokePath(c);
}
@end