When you implement a category of a class in a file, will all the instances of that class be of the category by default?
I'm new to Objective-C and I'm trying to make my uneditable UITextView non-selectable. I came across this answer using a category: https://mcmap.net/q/188420/-how-disable-copy-cut-select-select-all-in-uitextview
Which has the following solution:
@implementation UITextView (DisableCopyPaste)
-(BOOL) canBecomeFirstResponder
{
return NO;
}
@end
I added the snippet to my code, but it doesn't seem to be working in that I can still select the text. My declaration of the UITextView
is the usual:
titleLabel = [[UITextView alloc] initWithFrame:frame];
I tried changing the declaration to [DisableCopyPaste alloc]
but that didn't seem to work.. haha.
Thanks!
objective-c categories
#12261229 – Bondstone