视图中的动态刷新-xcode 4 / Interface builder

| 我是xcode的新手,所以请多多包涵。 我有一个已设置为空白的标签,并且在用户单击\'go \'后,我生成一个随机的单词或数字并使用: self.label.stringValue = \“ some_word \” 更新视图。 (我正在使用MacRuby btw) 但是,我想在显示最后一个单词之前快速连续显示20个左右的单词-只是因为此刻太无聊了。 (或者,我很乐意在其位置上显示动画图形-由最终的随机单词代替。) 我已经尝试过类似的事情:
100.times do
 num = rand(40)
 self.label.stringValue = num
end
但这是行不通的。我也尝试过.reloadData但也无济于事。 关于如何实现这一目标的任何想法?     
已邀请:
为了不让问题困扰,请从Macruby邮件列表中进行:
def drawWord(sender)
if !next_word
 self.timer.invalidate
 return
end
self.label.stringValue = next_word
self.setNeedsDisplay true
end

def next_word
...
end

self.timer = NSTimer.scheduledTimerWithTimeInterval( 1/20.0,
target:self, selector:\"drawWord:\", userInfo:nil, repeats:true)
    

要回复问题请先登录注册