Update the debug window on the main thread.

This commit is contained in:
Damiano Galassi committed 2014-10-24 11:46:16 +02:00
1 parent 6ee1e28c16
commit f667514d32
1 file changed
+5 -3
+5 -3
View File
@@ -32,9 +32,11 @@
}
- (void)log:(NSString *)string {
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string];
[[self.logView textStorage] appendAttributedString:attributedString];
[attributedString release];
dispatch_async(dispatch_get_main_queue(), ^{
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string];
[[self.logView textStorage] appendAttributedString:attributedString];
[attributedString release];
});
}
- (IBAction)clearLog:(id)sender {