每当“_currentField”(这是一个带有数字格式化程序的文本字段)的值大于或等于 1000 时,我希望“_congrats”(这是一个面板)显示出来,当它小于 1000 时,我想要“_errormsg”(另一个面板)显示。每次我输入任何值时,唯一弹出的是“_errormsg”。我究竟做错了什么?
- (void)onTimer:(NSTimer*)aTimer {
if ([_currentField.stringValue integerValue] >= 1000)
{
[_congrats orderFront:(id)self];
[_progIndicator stopAnimation:(id)self];
}
else {
[_errormsg orderFront:(id)self];
[_progIndicator stopAnimation:(id)self];
}
}