I am running another processing thread, and I would like to log results to a NSTextView, that when a new line is posted, it updates the view and positions the scrollbar to the bottom. Any suggestions?
- (void)runProc
{
do {
[NSThread sleepForTimeInterval:0.1];
[self reportInfo:@"tick"];
} while (stop == NO);
}
- (void)report:(NSString*)string;
{
[[consoleView textStorage] beginEditing];
[[[consoleView textStorage] mutableString] appendString:string];
[[[consoleView textStorage] mutableString] appendString:@"\n"];
[[consoleView textStorage] endEditing];
NSRange range;
range = NSMakeRange ([[consoleView string] length], 0);
[consoleView scrollRangeToVisible: range];
}
It gets to about 50 entries then locks the whole thing up.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)