First of all, if the code above does not work for you, you probably forgot to change the UITextView class to your own class that implements the method above.
After you have done what you have, you must work, and then you must return no to select all.
if (action == @selector(selectAll:)) { return NO; }
you can also return no for cut: also assuming that you do not want the user to delete the text from the text file.
In addition, it should not be if else expressions, since they are independent of each other
In fact, they are called in this order.
cut: copy: select: select all: paste: delete:
Thus, remove the functionality as needed.
source share