How have you done anything at all without knowing what NSLog is?
Ok, your screen shots are not appearing, so you'll need to host them somewhere else probably. I'm going to make a couple of guesses, but without seeing exactly what the problem is, it's a bit tough to be certain.
So, first of all, this line appears to be what sets the text for what I assume is a label or a text field:
Code:
tipAmount.text = [NSString stringWithFormat:@"Tip Level: %.2f%", tipTotal];
Are you literally seeing "..." or are you seeing "Tip Level: ..."? Please be specific.
Next, in order to find out if the issue is with the
data or the
display of the data, do something like this:
Code:
float tipTotal = tipSelected * 3.8 / [billTotal.text floatValue];
NSLog(@"tipTotal is: %f", tipTotal);
tipAmount.text = [NSString stringWithFormat:@"Tip Level: %.2f%", tipTotal];
View the log as you run your program. If this line produces the correct answer, then the issue is with the
display of your data. If it doesn't, then your
data is wrong.
Next, verify for your code. For example:
Code:
tipSelected = tipSelected;
This does nothing. Did you forget a + 1 or something? No idea what this was supposed to be, but as is it doesn't do anything.
Next, you need to be aware that special characters do certain things, especially the % sign. So when you are doing %d for an integer, or %f as you are here for the float, that % means something special. Because of that, you can't just stick a % in there and have it display as text. It is special, so you have to treat it as special. In this case, you have do to a double %% in order to get the display to be what you want (assuming you want something like 2.50% to appear). So your stringWithFormat line actually needs to look like:
Code:
tipAmount.text = [NSString stringWithFormat:@"Tip Level: %.2f%%", tipTotal];
Now I tested it as you have it here, and I never saw "..." in the log. I just saw the number without the % sign. So if you make the code changes I've indicated here, and you've verified that your data is correct, and it still isn't displaying correctly, then I still think that your label is too small. Make it bigger.