ios - NSInternalConsistencyException unexpected start date NSRunLoop -
i have following code in couple places (applicationwillenterforeground, didreceiveremotenotification) of app delegate.
//create semaphore dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); /* ... redacted code other stuff ... */ // wait 30 seconds reauth int ntimeout = 3; //holds thread until dispatch_semaphore_signal(semaphore); send while ((dispatch_semaphore_wait(semaphore, dispatch_time_now)) && ( ntimeout > 0 )) { [[nsrunloop currentrunloop] runmode:nsdefaultrunloopmode beforedate:[nsdate datewithtimeintervalsincenow:10]]; ntimeout --; }
the issue we're getting crashes on [[nsrunloop currentrunloop] runmode line following:
fatal exception: nsinternalinconsistencyexception 0 corefoundation 0x181f5edb0 __exceptionpreprocess 1 libobjc.a.dylib 0x1815c3f80 objc_exception_throw 2 corefoundation 0x181f5ec80 +[nsexception raise:format:] 3 foundation 0x1828e41c0 -[nsassertionhandler handlefailureinfunction:file:linenumber:description:] 4 uikit 0x187380984 _prepareforcaflush 5 uikit 0x187380820 __84-[uiapplication _handleapplicationactivationwithscene:transitioncontext:completion:]_block_invoke_2 6 corefoundation 0x181f14f84 __cfrunloop_is_calling_out_to_a_block__ 7 corefoundation 0x181f148bc __cfrunloopdoblocks 8 corefoundation 0x181f12820 __cfrunlooprun 9 corefoundation 0x181e3cc50 cfrunlooprunspecific 10 foundation 0x18284ccfc -[nsrunloop(nsrunloop) runmode:beforedate:]
does have idea why happening?
thanks in advance,
Comments
Post a Comment