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

python - Best design pattern for collection of objects -

go - serving up pdfs using golang -

python - django admin: changing the way a field (w/ relationship to another model) is submitted on a form so that it can be submitted multiple times -