I am new here and just started learning about Objective C.
I am having problem in making a calculator with codes.
For example, i want to set some codes e.g. A=55, B=42, C=19…..to Z= 66
Then allow user to type in any letter in the textfield and calculate the final sum of value.
My question is how can i set these codes (A-Z) then my calculation method can run user entered letters?
result.text = [[NSString alloc] initWithFormat:@"%i",????? ];
Many Thanks
The first thing that comes in my mind is to save those values in a
int[]and to retrieve them when you need. Of course it can be annoying to store all the values, especially if they don’t have a mathematical order.To get those values you may simply do something like
where
codesis theint[]where you stored your values andletteris the chose letter