我新的目標C和iPhone SDK,並正嘗試找出出發,按照標籤區域顯示一個數字結果的一個簡單的例子,顯示在iPhone的標籤面積數值:使用stringWithFormat
label.text = [NSString stringWithFormat: @"%d", 55];
上面的代碼在標籤區域顯示數字「55」。然而,在「0」的顯示如下代碼的結果(與calculationResult聲明爲在頭文件中的雙重可變型):
calculationResult = 55;
label.text = [NSString stringWithFormat: @"%d", calculationResult];
任何幫助十分讚賞。