I'm trying to declare a function within another function. So here's part of my code: ViewController.m
- (void)updatedisplay{
[_displayText setText:[NSString stringWithFormat:@"%d", counter]];
}
- (IBAction)minus1:(id)sender {
counter--;
updatedisplay();
}
ViewController.h
- (IBAction)minus1:(id)sender;
- (void)updatedisplay;
Which returned me the error of "Implicit declaration of function "..." is invalid in C99".
Result: https://i.sstatic.net/XGevK.png
I've found that people have encountered similar problem, but as a newbie I didn't really know what to do next. Thanks for your help! :)