Ive been having some trouble creating a set of level skip up/down buttons.
So far all ive got is two buttons and a label with 'Level @%' in it
- (IBAction)levelUpPressid)sender
{
if (levelText = '1')
[levelText = 2];
if (.... and so on
}
works in terms of changing the number in the label from 1 to 2 but a second press doesnt change it from 2 to 3... is there a simpler way or should i just crack on getting this to count upwards using ifs?
what is the level++ part? ive never come across it... \
basically right now all i need is to have a button that adds 1 to the value of a label and i was thinking of using the labels value to set the rest of the variables up....
what is the level++ part? ive never come across it... \
basically right now all i need is to have a button that adds 1 to the value of a label and i was thinking of using the labels value to set the rest of the variables up....
Compare the code originally posted with what you've currently got. Also, if you don't know what "++" does, you should locate a C language reference manual and keep it handy.
ok typo... but what do i do with the level bit...? the label will follow the number of my level.... but where do i define it? at the minute the 'level' is an undeclared function and i have no idea where to put it... sorry this part of programming is new to me completely.
ok typo... but what do i do with the level bit...? the label will follow the number of my level.... but where do i define it? at the minute the 'level' is an undeclared function and i have no idea where to put it... sorry this part of programming is new to me completely.
level is an NSInteger. I assumed you declared this in your header file.