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)'
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
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
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've set NSZombieEnabled to YES in my scheme but still no debug info. I am using Xcode 4.6.3.
I've read this question but it does not solve my issue: NSZombie Enabled but Still No Debug Info.
Here is the crash log,
-[MODELNode nodeList]: unrecognized selector sent to instance 0x1315170
2013-12-16 12:30:29.990 OHI Control[6198:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MODELNode nodeList]: unrecognized selector sent to instance 0x1315170'
*** First throw call stack:
(0x311c32a3 0x3906397f 0x311c6e07 0x311c5531 0x3111cf68 0x1a2273 0x333fc547 0x333fd789 0x333f4add 0x333f53eb 0x333f27d3 0x333fc685 0x333fcb3d 0x333e375f 0x32fce803 0x32d78d8b 0x32d78929 0x32d7985d 0x32d79243 0x32d79051 0x32fd48eb 0x311986cd 0x311969c1 0x31196d17 0x31109ebd 0x31109d49 0x34cd32eb 0x3301f301 0x2f15 0x3949ab20)
libc++abi.dylib: terminate called throwing an exception
How do I get this working correctly?
For adding Exception Break Point I am adding here images to explain how.
That's All. Hope this helps.