Mark,
Please accept my apologies for my late reply, but life has kept me away from the computer for a few days. I sincerely appreciate your very helpful comments.
1. Make sure you set a breakpoint in your program. The variable viewer in the debugger doesn't show anything unless you pause your program's execution.
Break point had been set in the method as described below
2. Make sure you're using the Debug build configuration. Use the Overview pulldown menu on the project window toolbar to set the active build configuration.
I checked and it was set as you described.
3. Make sure the Generate Debug Symbols build setting is activated. Choose Project > Edit Active Target to open the target inspector. Click the Build tab in the inspector. The Generate Debug Symbols build setting is in the Code Generation collection.
I checked and it was set as you described.
4. Are other variables like function arguments showing up in the variable viewer or is it only local variables that don't appear?
It is only local variables that are not showing up.
When I step through the code with the debugger I think that I should be able to see the local variable 'right_digit' which is in the method get
num_ofdigits, but it is never visible under the Variable > self folder of the debugger when I Step Over each line of code in that method.
This is the applicable code:
@interface Calculator : NSObject {
int accumulator, avg, right_digit, num, new_num;
int i, total, new_value;
}
...
-(int) get
num_ofdigits : (int) number : (int) value_2;
...
@end // end of interface section
@implementation
...
-(int) get
num_ofdigits : (int) number : (int) value_1 { // << break point set here
while ( number != 0 ) {
right_digit = number % 10;
++value_1;
number /= 10;
}
return value_1;
}
@end // end of implementation section
In main () we have the following:
int value_1, number, result, n, new_num;
value_1 = 0;
printf("Enter your number =>>>> " );
scanf ("%i", &number);
// number entered = 123
result = [ myCalculator get
num_ofdigits : number : value_1 ];
In a nutshell - once I get to the method break point all that the debugger sees under the self folder is:
_cmd some hex #
number 123 = value entered in main()
value_1 0 ( = initial value )
the other Variables - Globals, Registers, Vector Registers and x87 Registers do not contain the variable of interest.
Thanks again for your help,
Phillip Anthony