석영의 기초를 배우려고하는데이 기능이 작동하지 않는 이유를 모르겠다. - 버튼을 밀 때 바로 빨간색 직사각형을 움직여야한다. 아무것도 을 -은 "NSLog (A"도움말 "); 버튼 을 작동하는 경우 알아 내기 위해 노력했다 - 감사석영의 이동 사각형
@implementation QuartzView
-(IBAction)moveRight:(id)sender{
NSLog(@"Help");
lR += 50;
}
- (id)initWithFrame:(NSRect)frameRect
{
self = [super initWithFrame:frameRect];
if (self) {
}
return self;
}
- (void)drawRect:(NSRect)dirtyRect
{
CGContextRef myContext = [[NSGraphicsContext // 1
currentContext] graphicsPort];
// Drawing code here.
CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);// 3
CGContextFillRect (myContext, CGRectMake (lR, 0, 200, 100));
[self setNeedsDisplay:YES];
}
@end
감사
촬영은, i)는 "CGRectMake (LR, 0, 200, 100) 말을 마지막 줄 의미, – user2073270
당신을 위해 그것을 해결 당신은 귀하의 게시물을 편집 할 수 있습니다, BTW – Jeremy