Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

后端 未结 6 2016
故里飘歌
故里飘歌 2020-12-01 00:28

I am using google maps in Xcode 9 beta, iOS 11.

I am getting an error outputted to the log as follows:

Main Thread Checker: UI API called on a

6条回答
  •  爱一瞬间的悲伤
    2020-12-01 00:59

    Wrap the lines of code that modify the UI in DispatchQueue.main.async {} in order to make sure they execute on the main thread. Otherwise, you may be calling them from a background thread, where UI modifications are not allowed. All such lines of code must be executed from the main thread.

提交回复
热议问题