このコードで長方形を作成しましたが、動作します:
- (void)drawRect:(CGRect)rect{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddRect(context, CGRectMake(60, 60, 100, 1));
CGContextStrokePath(context);
}
しかし、今は影をつけたいので、これを試しました:
NSShadow* theShadow = [[NSShadow alloc] init];
[theShadow setShadowOffset:NSMakeSize(10.0, -10.0)];
[theShadow setShadowBlurRadius:4.0];
しかし、xcodeは私に教えてください NSMakeSize : Sending 'int' to parameter of incompatible type 'CGSize'
影について正しい形はどれですか? ありがとう!!