GL 페인트 응용 프로그램을 개발 중입니다.배경에서 UIView 페인팅 NSThread?
개체를 페인트하려면 구현 된 UIView를 사용하고 있습니다.
시작 페인트 방법 :
- (void)viewDidLoad {
....
[NSThread detachNewThreadSelector:@selector(paintingObjects)
toTarget:self
withObject:nil];
}
- (void)paintingObjects {
while(1) {
[NSThread sleepForTimeInterval:2];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
ImplementedView *tmp = [self view];
[tmp draw];
[pool drain];
}
}
그러나 (개체를 페인트하지 않습니다) 작동하지 않습니다.
무엇이 잘못 되었나요?
제발 도와주세요.
미리 감사드립니다.
내가 아는 한, UI 객체는 스레드로부터 안전하지는 않지만, 내가 틀렸다는 것을 자유롭게 인정합니다. –