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
+2
+2
View File
@@ -32,9 +32,11 @@
} }
- (void)log:(NSString *)string { - (void)log:(NSString *)string {
dispatch_async(dispatch_get_main_queue(), ^{
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string]; NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string];
[[self.logView textStorage] appendAttributedString:attributedString]; [[self.logView textStorage] appendAttributedString:attributedString];
[attributedString release]; [attributedString release];
});
} }
- (IBAction)clearLog:(id)sender { - (IBAction)clearLog:(id)sender {