Imagine that a method is going to add an object to either a certain NSMutableArray or NSMutableDictionary. Is it better (and why) to allow just a single argument with type id, or allow two--one for the array and one for the dictionary?
For example:
- (void)addObjectToArray:(NSMutableArray *)anArray orDictionary:(NSMutableDictionary *)aDictionary; vs.
- (void)addObjectToArrayOrDictionary:(id); If using the first option, I'd just pass nil as the parameter to whichever one I don't need (i.e. if adding to a dictionary, i'd pass nil as the array parameter).