No 1 in (serious) series of coding style…

No 1 in (serious) series of coding style posts: Private methods

Declaring private methods in a class extension (like an anonymous category) rather than a named category makes the compiler warn you when those methods aren’t implemented.

# MyClass.h
 
@interface MyClass : NSObject {
}
- (void)publicMethod;
@end
 
 
# MyClass.m
 
#include "MyClass.h"
 
@interface MyClass ()
- (void)privateMethod;
@end
 
 
@implementation MyClass
 
- (void)publicMethod;
{
    NSLog(@"public");
}
 
- (void)privateMethod;
{
    NSLog(@"very private");
}
 
@end