问题
I write the code below:
JSImgDeleteCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:displayCellID forIndexPath:indexPath];
and before use it,I registered it:
[_displayImgCollectionView registerNib:[UINib nibWithNibName:displayCellID bundle:nil] forCellWithReuseIdentifier:displayCellID];
it is allright in xcode7.3, but when I run this in xcode8.1,there is sth wrong,the msg like this:
invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.
libsystem_c.dylib`__abort:
0x18ce163ec <+0>: adrp x8, 150192
0x18ce163f0 <+4>: add x8, x8, #0 ; =0
0x18ce163f4 <+8>: ldr x9, [x8, #8]
0x18ce163f8 <+12>: cbnz x9, 0x18ce16408 ; <+28>
0x18ce163fc <+16>: adrp x9, 27
0x18ce16400 <+20>: add x9, x9, #1393 ; =1393
0x18ce16404 <+24>: str x9, [x8, #8]
0x18ce16408 <+28>: stp x20, x19, [sp, #-32]!
0x18ce1640c <+32>: stp x29, x30, [sp, #16]
0x18ce16410 <+36>: add x29, sp, #16 ; =16
0x18ce16414 <+40>: sub sp, sp, #32 ; =32
0x18ce16418 <+44>: add x8, sp, #16 ; =16
0x18ce1641c <+48>: add x19, x8, #8 ; =8
0x18ce16420 <+52>: movn w20, #0
0x18ce16424 <+56>: stp xzr, x20, [sp, #16]
0x18ce16428 <+60>: orr w0, wzr, #0x6
0x18ce1642c <+64>: add x1, sp, #16 ; =16
0x18ce16430 <+68>: movz x2, #0
0x18ce16434 <+72>: bl 0x18cdc552c ; sigaction
0x18ce16438 <+76>: ldr w8, [sp, #24]
0x18ce1643c <+80>: and w8, w8, #0xffffffdf
0x18ce16440 <+84>: str w8, [sp, #24]
0x18ce16444 <+88>: str w20, [sp, #12]
0x18ce16448 <+92>: orr w0, wzr, #0x3
0x18ce1644c <+96>: add x1, sp, #12 ; =12
0x18ce16450 <+100>: movz x2, #0
0x18ce16454 <+104>: bl 0x18ce2b814 ; symbol stub for: __printf_arginfo_n
0x18ce16458 <+108>: orr w0, wzr, #0x1
0x18ce1645c <+112>: bl 0x18cf6a470 ; __pthread_workqueue_setkill
0x18ce16460 <+116>: orr w0, wzr, #0x3
0x18ce16464 <+120>: mov x1, x19
0x18ce16468 <+124>: movz x2, #0
0x18ce1646c <+128>: bl 0x18cf6885c ; pthread_sigmask
0x18ce16470 <+132>: bl 0x18cf6d908 ; pthread_self
0x18ce16474 <+136>: orr w1, wzr, #0x6
0x18ce16478 <+140>: bl 0x18cf6a3e0 ; pthread_kill
0x18ce1647c <+144>: movz w0, #0x2710
0x18ce16480 <+148>: bl 0x18cdf2b1c ; usleep$NOCANCEL
0x18ce16484 <+152>: orr w8, wzr, #0xffffffe7
0x18ce16488 <+156>: str w8, [sp, #24]
0x18ce1648c <+160>: orr w0, wzr, #0x3
0x18ce16490 <+164>: mov x1, x19
0x18ce16494 <+168>: movz x2, #0
0x18ce16498 <+172>: bl 0x18ce2b814 ; symbol stub for: __printf_arginfo_n
-> 0x18ce1649c <+176>: brk #0x1
please help!
回答1:
I had faced the same issue
CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.
But I found this is not the real reason behind crashing the app, the real reason i found below the above message as Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]:unrecognized selector sent to instance 0x102ed2fb0' on console is real reason. So, I handle the null value which i received from backend.
回答2:
In my case, I accidentally added two reference to the same Xib constraint. Removed one and it works well.
回答3:
sorry,it's just the index lost and Apple changed the error log,just add the .m file
来源:https://stackoverflow.com/questions/40397425/xcode8-1invalid-mode-kcfrunloopcommonmodes-provided-to-cfrunlooprunspecific