Re: unable to update UI on main thread in 10.13

2017-10-28 Thread sqwarqDev
> > Better still, don’t store the attributed string persistently anywhere, but > pass it through the background processing then on to the main thread as a > parameter to the updateUI function. Thanks for that suggestion; it wasn’t the answer, but it did lead me to rewrite significant portions

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread Alex Zavatone
I’m not sure if this is related or not but this is the only item that I have seen (albeit on iOS) where the UI simply would not update on the main thread and it only happened on an iPad. This was issuing a makeFirstResponded to a UITextField to display a keyboard. The keyboard display simply d

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread Quincey Morris
On Oct 27, 2017, at 07:40 , sqwarqDev wrote: > > It seems to be when the superAttributedString is added that I get the > warnings. — Is that backtrace from the main thread? — The symptoms you describe might be explained if the text storage is holding on to a reference to the attributed string

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread sqwarqDev
Yeah, I should probably have explained the structure. After years of objective-c this is my first time with both swift and storyboards, so…that may well be where the problem lies. Anyway, it goes like this, the ViewController instantiates an instance of my subclassed NSTextView. The subclasse

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread David Duncan
> On Oct 27, 2017, at 7:17 AM, sqwarqDev wrote: > > >> On 27 Oct 2017, at 21:11, David Duncan wrote: >> >> In your background task which attributed string are you modifying? From the >> looks of your ‘updateUI’ function it seems like you are modifying the one >> that NSTextView provides, w

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread sqwarqDev
> On 27 Oct 2017, at 21:11, David Duncan wrote: > > In your background task which attributed string are you modifying? From the > looks of your ‘updateUI’ function it seems like you are modifying the one > that NSTextView provides, which is likely to actually be an instance of > NSTextStorage

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread David Duncan
In your background task which attributed string are you modifying? From the looks of your ‘updateUI’ function it seems like you are modifying the one that NSTextView provides, which is likely to actually be an instance of NSTextStorage and sending callbacks to the NSTextView to update itself – w

unable to update UI on main thread in 10.13

2017-10-27 Thread sqwarqDev
I have a subclass of NSTextView which I'm trying to update in my UI. When the user clicks a button in the main UI, I run a bunch of processes in the background, save their output to an attributed string, then update the textview's textstorage on the main thread using performSelector(onMainThread