我的NSTextField包含雙打像「1.67」或「0.05」等如何獲取NSTextField中的值?
當我嘗試以下方法:
console.log([priceChange doubleValue]); //priceChange is an NSTextField
//Apply styles
if([priceChange doubleValue] > 0)
[priceChange setTextColor:[NSColor greenColor]];
else if([priceChange doubleValue] < 0)
[priceChange setTextColor:[NSColor redColor]];
else if([priceChange doubleValue] == 0)
[priceChange setTextColor:[NSColor blackColor]];
priceChange等於0始終,即使價值是另一回事。我怎樣才能正確地獲得priceChange的價值?
console.log()?這是Objective-C還是Objective-J?卡布奇諾咖啡或可可粉? – d11wtq 2011-01-05 06:51:43
只是一個想法,但'priceChange'零,不知何故? – d11wtq 2011-01-05 06:53:03