I have a few methods for initialization of different stuff in my class implementation. However, when I invoke these methods by using [self 'methodName'], the Xcode compiler gives me a warning that I could not get rid of.
'className' may not respond to 'methodName'
For example,
warning: 'NextJackpotViewController' may not respond to -initActivityIndicator'
- (void)viewDidLoad {
[self initActivityIndicator];
[self addRefreshButton];
[self updateUI];
[super viewDidLoad];
}
Anything that could be done to get rid of this?
There are 3 ways to do this. The first is to just put the method declaration in your header file like Matt said.
The second is by creating Private Methods you can do this by putting the following code at the top of your controller
@interface NextJackportViewController (PrivateMethods) - (void)initActivityIndicator; @end
The third way is to define the method before you call it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With