2012-04-11 68 views
0

在我的Cocoa應用程序中,我在NSTextView中顯示了一個計算結果,現在我希望您可以在NSextField中看到結果,但我沒有成功。在文本字段標籤中顯示變量

[textField insertText:[NSString stringWithFormat:@"%i \n", giorni]]; 
+0

什麼是GIORNI價值?你有沒有在調試器中看過它? – 2012-04-11 16:43:45

+0

整數值 – Andrea 2012-04-11 17:05:03

回答

0

如何:(編輯爲NS,而不是UI文本框)

[textField setIntValue:giorni]; 
+0

我已經嘗試過,但他給了我錯誤:'NStextField'的可見@接口聲明瞭選擇器'setText'。 – Andrea 2012-04-11 17:36:43

+0

已更新的答案,以表示它是NSTextField – lnafziger 2012-04-11 17:53:34

+1

您太棒了,謝謝! – Andrea 2012-04-11 19:38:18

相關問題