-1
我有一個NSTextView我正在追加控制檯日誌。我已經在滾動視圖的XIB文件中實現了這個UI。當我的應用程序在文本視圖中追加控制檯日誌時,我希望滾動條自動轉到文本視圖的末尾。我在XIB編輯器中找不到任何屬性。任何想法我怎麼能做到這一點?自動滾動到NSTextView的末尾
@property(nonatomic, strong) IBOutlet NSTextView *logTextView;
[[self.logTextView textStorage] beginEditing];
[[[self.logTextView textStorage] mutableString] appendString:iData];
[[[self.logTextView textStorage] mutableString] appendString:@"\n"];
[[self.logTextView textStorage] endEditing];