In Objective-C, the proper terminology is not to “call a method on” an object, but to “send a message to” an object.
That makes the decision easy: Are you sending a message to an object? Are you telling it to do something or asking it for information? If so, then make the object respond to that message by putting the code in a method. If not (if the task is independent of any object), then make it a function.
You might browse the Foundation functions, UIKit functions, and AppKit functions lists for examples of the sort of object-independence that makes something belong in a function rather than a method.
I'm about to create a function which adds to NSDateComponents together is there any advantage to putting this in a C style function or should it go in a Obj-C method?
I would put that into an instance method categoried onto NSDateComponents. The call (message) would look like [componentsA componentsByAddingComponents_PRH:componentsB]
. (Note that I included my initials so that if Apple ever adds a componentsByAddingComponents:
method of their own, my app's behavior won't suddenly change when users upgrade their devices to the new OS.)
One existing example of this is NSDecimalNumber's decimalNumberByAdding:
method.