GCD, NSThread, and performSelector:onThread: issues

后端 未结 3 1177
日久生厌
日久生厌 2021-01-23 00:58

I\'m attempting to debug some iOS crash logs that contain the following error message:

*** Terminating app due to uncaught exception \'NSDestinationInvali

3条回答
  •  [愿得一人]
    2021-01-23 01:17

    To your first Q:

    I think the thread, sending the message is meant. But I cannot explain how this can happen.

    Second: I would not mix NSThread and GCD. I think that there will be more problems than solutions. This is because of your last Q:

    Each block is running on one thread. At least this is done, because thread migration for a block would be expensive. But different blocks in a queue can be distributed to many threads. This is obvious for parallel queues, but true for serial, too. (And have seen this in practice.)

    I recommend to move your whole code to GCD. Once you are convenient with it, it is very easy to use and less error prone.

提交回复
热议问题