Question: I have menu items which are to be styled as follows:

![enter image description here](https://i.stack.imgur.com/IcUhj.png)

The arrow at the end I am achieving with an :after pesudo-class:

```
.ride-type-menu:after{
        content:"";
        border: 13px solid;
        border-color:  transparent #DBD7D7;
        border-right-color: transparent;
        right: -26px;
        top: 0;
        position: absolute;
        display: block;
    }

```

The issue I have is when these menu items stretch down onto multiple lines:

![enter image description here](https://i.stack.imgur.com/wQDFu.png)

Can anyone think of a way (even with an image if necessary) that I can increase the height (keeping the width) of the arrow automatically based on the number of lines the menu item takes up to achieve something like this:

![enter image description here](https://i.stack.imgur.com/ao5sJ.png)

Answer: 
Depends on if "Touchable" represents a random set of behaviors that each class must explicitly implement to support or if there can be a single implementation that "just works" with inheritance (with, maybe, a bit of customization).

If the former, then your thinking is mostly correct. If the latter, then Jack's suggestion of using an `@protocol` (which is a lot like an Interface in Java) makes sense.

Personally, I'd keep it really simple. Start with an `SPAbstractSprite` class that is a subclass of `CCSprite`. Then, subclass that into `SPBox` and `SPMotor`. 

Start your implementation in `SPBox` and/or `SPMotor` and, as common things fall out, refactor them into `SPAbstractSprite`.

As for the notion of "touchable", I wouldn't worry about trying to make that a named thing for now. Approach it the same way as above; implement touchable support in your motor or box, then refactor up to the abstract parent class later.

I am, quite admittedly, a very design-and-code-interleaved person, though, and fully acknowledge that there are those who really like to sit down and draw out a nice set of box/lines/hierarchy before writing a line of code.

In any case, you should note that the class hierarchies across the Apple provided classes and examples tend to be quite shallow and don't tend to do a huge amount of this abstraction, though abstraction is still used heavily (`UIView` is an abstract container for all the view like goop that all those subclasses need, for example).
I previously explained why [subclassing CCSprite is almost always a bad idea](https://stackoverflow.com/a/8043643/201863). 

"Touchable" as the name suggests is an ability of an object. A node can either be touched, or it can not. Moreover, this must not be restricted to sprites. What if later on you want a touchable label, a touchable particle effect, or some other touchable node class? 

Obviously you can't subclass CCNode to make it touchable and then turn subclasses of that touchable node class back into sprites, labels, etc. because cocos2d already established a class hierarchy - this is where the inflexibility of such a hierarchical system surfaces, and starts becoming a real pain.

You could add such a touchable (or killable, flying, jumping, drivable, swipeable, etc) ability to any object, at any time, and you could take it away at any time as well. That makes it a candidate for a [plugin class (a component)](http://www.learn-cocos2d.com/2010/06/prefer-composition-inheritance/). Any ability, especially those that may be temporary, should not be part of a superclass but instead be additional objects that you can add to an existing object, and enable/disable as needed.

One way to go about this is to use the userObject property of nodes. Write an Abilities container class, and assign it to the userObject of your nodes. Then add the desired Ability classes to the container of a node. The node then updates the userObject container class by forwarding the update method, which forwards update to all abilities. Or the Ability container itself registers with CCScheduler to receive updates. The only thing the container class and ability classes need is a (weak) reference to the owning node.