我有一个NSTextView我想使用空格而不是制表符的地方。我虽然我会replaceOccurrencesOfString:withString:options:range:在textStorageWillProcessEditing:我的,textview delegate但它不起作用(撤消中断)。
请问,有谁知道如何实现这样的功能?还有其他方法吗?
编辑:这就是我在textStorageWillProcessEditing:方法中所拥有的:
ts = [notification object];
[[ts mutableString] replaceOccurrencesOfString:@"\t"
withString:@" "
options:NSLiteralSearch
range:[ts editedRange]];