• 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: [NSButton state] must by used from the main thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSButton state] must by used from the main thread


  • Subject: Re: [NSButton state] must by used from the main thread
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 26 Sep 2017 08:19:04 -0700


> On Sep 26, 2017, at 1:16 AM, Tamas Nagy <email@hidden> wrote:
>
> “state” of the NSButton is a NSInteger property, so that should be safe to
> read from a background thread, right?

No. You can’t tell anything about a property’s implementation from its return
type. You’re assuming it’s a synthesized getter, but there’s no reason it
couldn’t be a custom method that does arbitrary computation before returning
the value, and there’s no way to know whether that work is thread-safe or not.

—Jens
_______________________________________________

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: [NSButton state] must by used from the main thread
      • From: Quincey Morris <email@hidden>
References: 
 >[NSButton state] must by used from the main thread (From: Tamas Nagy <email@hidden>)

  • Prev by Date: High Sierra Firmware Update
  • Next by Date: Re: [NSButton state] must by used from the main thread
  • Previous by thread: Re: [NSButton state] must by used from the main thread
  • Next by thread: Re: [NSButton state] must by used from the main thread
  • Index(es):
    • Date
    • Thread