Displaying numeric value in iPhone shortcut area using stringWithFormat
I am new to Objective C and iPhone SDK and I am trying to understand the following as a simple example of displaying a numeric result in the label area:
label.text = [NSString stringWithFormat: @"%d", 55];
This code shows the number "55" in the label area. However, the following code results in displaying "0" (with the computationResult declared as a double variable type in the header file):
calculationResult = 55;
label.text = [NSString stringWithFormat: @"%d", calculationResult];
Any help is greatly appreciated.
+2
source to share