Friday, September 12, 2014

iOS 게임 렌더링 루프 만들기

// 선언
@interface RenderView : UIView 
{
    CADisplayLink *displayLink;
}

// 초기화 
displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(runLoop)]; 
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];

// 루프함수
-(void)runLoop {
    NSLog(@"runLoop");
    [self setNeedsDisplay];
}

No comments:

Post a Comment