Log on main thread

This commit is contained in:
Matthias Neeracher 2017-11-24 06:01:22 +01:00
parent 423250f8cd
commit 8cdf61cf07

View File

@ -45,10 +45,11 @@
[log setString: logText];
while ((data = [h availableData]) && [data length]) {
NSString * append = [[[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding] autorelease];
[logText appendString: append];
[log setString: logText];
[log scrollRangeToVisible: NSMakeRange([logText length], 0)];
dispatch_sync(dispatch_get_main_queue(), ^{
[logText appendString: append];
[log setString: logText];
[log scrollRangeToVisible: NSMakeRange([logText length], 0)];
});
[pool release];
pool = [[NSAutoreleasePool alloc] init];
}