views:

5

answers:

0

In my application I'm using custom attributes to contain text I want to hide or unhide.

When text is hidden, it contained as the value (as NSAttributedString) of the custom attribute "Hidden", for example, in a special character sequence (for example (H)).

This all works super. I don't about saving the custom attribute when I save the document or pasting into another application. But I'd like to give a warning before allowing the user to delete either by deleting selection or using either backspace or forward delete key.

Does this require subclassing, or is there some way to protect certain ranges or attributes?