Is the inference now that I've got to check every object is not nil before using it in methods?
No, that is not the inference. The inference is that you have to check the date reference you're sending to NSCalendar
, because the result of sending it a nil reference is undefined. It might work for you at the moment, but Apple could change the behavior in a future release to do whatever it wants, up to and including clubbing a baby seal. Oh, won't you please think of the baby seals?
Am I doing something totally heinous working with nil objects?
No. It's 100% fine to send a message to a receiver that might be nil, if the result you want back is nil or zero in that case. In this case, you're not sending a message to nil. You're sending a nil argument to a non-nil receiver that wasn't expecting it. In one case, the receiver is nil; in the other case, the argument is nil.