我是 iPhone 开发的新手。我有一个游戏循环设置如下。
(void)CreateGameTick:(NSTimeInterval) in_time
{
  [NSThread detachNewThreadSelector:@selector(GameTick) toTarget:self withObject:nil];
}
我的基本游戏滴答/渲染看起来像这样
(void)GameTick
{
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  CGRect wrect = [self bounds];
  while( m_running )
  {
    [self drawRect: wrect];
  }
  [pool release];       
}
我的渲染函数被调用。然而,什么都没有被绘制(我正在使用 Core Graphics 在派生的 UIView 上绘制一些线条)。
如果我通过计时器调用我的更新,那么一切都很好。
你能告诉我为什么通过线程完成渲染会失败吗?是否有可能通过线程使其工作?
谢谢丰富