Thread 1: signal SIGABRT
Terminating app due to uncaught exception 'NSInvalidArgumentException'
What does this error indicate?
This kind of error usually occurs when you try to pass an invalid argument as a parameter of the function. For example: if function requires non-nil value, but your variable is nil. See Apple documentation: https://developer.apple.com/documentation/foundation/nsinvalidargumentexception
Related
Here is the detailed error description that I am receiving in debugger bar
*** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason:
'-[_NSConcreteBlockSinkObservation superlayer]: unrecognized selector
sent to instance 0x6000005a4000'
Why this is happening and what will be the solution to it?
Update:
I tried to remove some lines of code for testing, then I found another error like below
[__NSDictionaryM superlayer]: unrecognized selector sent to instance
0x6000008e8ee0
I am trying to run app on the iphone 6 and I get this error. I get the error after making the facebook login. Normally, it is working successfully on the simulator. I couldn't find why it gives the error.
Error:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray'
*** First throw call stack:
(0x181dcae38 0x18142ff80 0x181d41a6c 0x100418620 0x100417aa0 0x10042dbac 0x10006a3a0 0x10006aa0c 0x186f14b40 0x186f14744 0x1872ba9fc 0x1872774f4 0x187273f04 0x1871c6fd8 0x1871d4990 0x186f064a4 0x181d807b0 0x181d7e554 0x181d7e984 0x181ca8d10 0x183590088 0x186f7df70 0x10008810c 0x1818468b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
Since you posted no stack trace, I assume you want to learn how to find bugs like this. First, in Xcode, set a breakpoint on Objective-C exceptions, so you find where exactly the crash happens.
The error says clearly that you are trying to access array [0] for an NSArray that is empty. Once you find the location of the crash that should be easy to find.
So in the app that I am developing I have multi threading. There are some thread that call managedObjectContext from appeDelegate and update database and also calling the same managedObjectContext to retrive data.
Sometimes I am getting the following error on this line.
2016-04-01 19:23:41.094 Tamil League[878:219638] -[_CDSnapshot_Matches_ values]: unrecognized selector sent to instance 0x17e5c790
2016-04-01 19:23:41.095 Tamil League[878:219638] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_CDSnapshot_Matches_ values]: unrecognized selector sent to instance 0x17e5c790'
*** First throw call stack:
(0x245362eb 0x23d02dff 0x2453bab5 0x2453970f 0x24468c88 0x25d31985 0x25d31343 0x25c925fd 0x25c91375 0x25c5e8c1 0x25d1a4d7 0x25d22b47 0x149acab 0x14a44a3 0x25d14929 0x25c5e3b7 0x25c813ab 0xe0e70 0xdd9c4 0x24a3796d 0x24a46ef7 0x24d3a52d 0x24c9beff 0x24c8e2ef 0x24d3c7ed 0x14a55c3 0x149defb 0x14a6ab7 0x14a6909 0x2426ce0d 0x2426c9fc)
libc++abi.dylib: terminating with uncaught exception of type NSException
I tried to search on net but nothing improved my problem. Does anyone know how to solve this in swift 2.0?
I am trying to run my application and suddenly i get this error:
2014-11-05 12:12:54.972 [238:9512] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ''
*** First throw call stack:
(0x235a7c1f 0x30dafc8b 0x235a7b65 0x299b61 0x299adf 0x322ec7 0x13b50d 0x242b6d6f 0x2356e377 0x2356d787 0x2356bded 0x234ba211 0x234ba023 0x2a86d0a9 0x26ac61d1 0x102bff 0x102b88)
libc++abi.dylib: terminating with uncaught exception of type NSException
It's on the start of the application,
i get this error without changing any code in my project, any idea what can cause this?
To resolve the NSException crashes, you have to remove all the warnings of .xib/.storyboard files. Cross check the IBOutlets warnings and you can see a cross (X) icon related to the yellow warnings to remove it.
I am trying to use Instruments to detect following error. Could someone please tell me if it is possible to get the line that causes this exception using Instruments. Thanks.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: username)'