The following is an example of hidden method in Objective-C:
MyClass.m
#import "MyClass.h"
@interface MyClass (Private)
-(void) privateMethod:(NSString *)arg1 and: (NSString*)arg2;
@end
@implementation MyClass
-(void) publicMethod {
NSLog(@"public method\n");
/*call privateMethod with arg1, and arg2 ??? */
}
-(void) privateMethod:(NSString *)arg1 and: (NSString*)arg2{
NSLog(@"Arg1 %@ and Arg2 %@", arg1, arg2);
}
@end
I've read about private interface / methods declaration. But how to invoke them from an other public method ?
I've tried [self privateMethod:@"Foo" and: @"Bar"]
but it doesn't looks right.