In Java, I like to start methods with using Guava's Preconditions class to make sure the method parameters are not null, or are valid values. For example:
public void myMethod(String str) {
Preconditions.checkNotNull(str);
... method logic here ...
}
This is an important part of my approach to coding. Is there something similar in Objective-C?
The equivalent is NSParameterAssert, defined in NSException.h. It's not as full-featured as Guava's, though.