xcode9 beta - How to mark methods to be invoked only from the main thread in Obj-C? -


i'm experimenting new xcode 9 main thread checker

this pretty neat. i'd mark / annotate obj-c methods invoked main thread main thread checker can kick-in automatically when attached debugger. can't find way this.

you can't (see update). use assert manually (like pspdfkit example)

assert(thread.ismainthread, "method must called mainthread only!") 


update:

there's no way. tweet employee:

unfortunately not; cannot teach main thread checker apis (cc @kubamracek)

by @zaks_anna (program analysis @apple)


update2: there's open radar being tracked apple, id#32659599. hopefully, implemented soon™.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -