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

android - IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling -

go - serving up pdfs using golang -

how to add preprocess loader in webpack 2 -