iOS something is trying to start the receiver simultaneously from more than one thread

0x00

Trapped uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSOperationInternal _start:]: something is trying to start the receiver simultaneously from more than one thread'

自定义operation和NSInvocationOperation一样,
如果直接调用start方法,不把operation添加到操作队列中,任务直接在当前线程同步执行。

如果把自定义operation添加到操作队列,那么任务会在新线程中异步执行。

警告:不要即把操作添加到操作队列中,又调用操作的start方法,这样是不允许的!否则运行时直接报错。

参考

https://blog.csdn.net/chuange6363/article/details/100754692/


猜你喜欢

转载自blog.csdn.net/xjh093/article/details/105289377