I'm creating a doubly-linked list in Objective-C. I would like my node class to include an instance method that allows me to add another node after the target node, like so:
// start <-> nodeA <-> nodeB <-> nodeC <-> end
Node * newNode = [Node node];
[NodeB thisMethodNeedsAGoodName:newNode];
// start <-> nodeA <-> nodeB <-> newNode <-> nodeC <-> end
What would be a good name for this method? insertAfter:
sounds wrong, since that implies that the target is being inserted, not the new node. insertNode:
would be OK, except that I'd like to write another method to insert a node before the target node, and then I'd have to come up with a different name for that method.
Any ideas?