The NSTextView delegation method is textView: shouldChangeTextInRange: replacementString: will allow you to do this. You can "just say" NO "to change .;-)
Update / Development (November 2015)
To develop based on the comments on this answer, the idea is to use your own custom attributes in the attribute string , your textual editing view. In addition to the standard attributes , you can specify your own attribute name (any NSString) and a PLIST-compatible object as a value for this name.
, "uneditable", () @"TextIsEditableAttributeName" NSNumber BOOL YES NO: [NSNumber NO] @( NO ) ( - ObjC - : NSNumber), , , , @"TextIsEditableAttributeName".
, , , . NSData , . @"EditingLocked" - . , @"EditingLocked" NO . ( ) .
, , -textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:, , "" . , "" , @"EditingLocked", .
, .