I have a singleton MyClass in Objective-C. In the singleton, let's say I have a method -(void)foo
that other classes message using [[MyClass sharedManager] foo]
.
In foo, I call a "private" method -(void)bar
implemented in MyClass. So something like this:
-(void)foo {
[self bar];
}
Since I want bar to be private (as private as possible in Objective-C), I don't have the definition of bar in my MyClass.h file. This causes a warning in XCode:
Method '-bar' not found (return type defaults to 'id')
How do I have private methods in my singleton class?