• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: unable to update UI on main thread in 10.13
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unable to update UI on main thread in 10.13


  • Subject: Re: unable to update UI on main thread in 10.13
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 27 Oct 2017 10:58:43 -0700

On Oct 27, 2017, at 07:40 , sqwarqDev <email@hidden> 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 object you set, and you subsequently
modify the same attributed string object. After you “push” the object in
“superAttributedString” to the main thread, do you create a new object in that
variable? What happens if you set a copy of the attributed string into the text
storage? Something like:

>
> self.profilerTextView.textStorage?.setAttributedString(self.superAttributedString.copy
>  ())

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.

Also, in this context:

> I AM seeing odd behaviour in 10.13 (the attributed string is supposed to bold
> certain parts of the text, but one time in ten or so in 10.13 it just goes
> gung-ho and bolds the lot)

it sounds like it could be a thread safety issue, which could lead to both this
and the original problem.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: unable to update UI on main thread in 10.13
      • From: sqwarqDev <email@hidden>
    • Re: unable to update UI on main thread in 10.13
      • From: Alex Zavatone <email@hidden>
References: 
 >unable to update UI on main thread in 10.13 (From: sqwarqDev <email@hidden>)
 >Re: unable to update UI on main thread in 10.13 (From: David Duncan <email@hidden>)
 >Re: unable to update UI on main thread in 10.13 (From: sqwarqDev <email@hidden>)
 >Re: unable to update UI on main thread in 10.13 (From: David Duncan <email@hidden>)
 >Re: unable to update UI on main thread in 10.13 (From: sqwarqDev <email@hidden>)

  • Prev by Date: Re: unable to update UI on main thread in 10.13
  • Next by Date: Re: unable to update UI on main thread in 10.13
  • Previous by thread: Re: unable to update UI on main thread in 10.13
  • Next by thread: Re: unable to update UI on main thread in 10.13
  • Index(es):
    • Date
    • Thread