Since updating to XCode 10.2 we have started seeing crash reports with the exceptions,
NSException: -[__NSCFNumber member:]: unrecognized selector sent to instance 0x8000000000000000
NSException: -[NSIndexPath member:]: unrecognized selector sent to instance 0x8000000000000000
NSException: -[__NSTaggedDate member:]: unrecognized selector sent to instance 0x8000000000000000
I've located the place in which the Exception happens, but I'm 100% sure that the dictionary in question doesn't have a IndexPath or a Date in it and the Memory address seems a little odd to me, its always the same. In fact at the point of the crash the dictionary has a valid key and the dictionary is valid.
In XCode 10.1 this doesn't happen, I've also found an article on Stack of one person who experienced a similar issue
'-[_NSCoreDataTaggedObjectID objectForKey:]: unrecognized selector sent to instance 0x8000000000000000'and their app didn't even use core data!
They changed their Optimization Level from No Optimization to Optimise for speed -O would this have an impact, I'm about to try it but I wanted a 2nd opinion or some pointers that would cause the above.
Thanks
I've located the place in which the Exception happens, but I’m 100% sure that the dictionary in question doesn't have a
or aIndexPathin itDate
Right. This is common in situations like this. The issue is the object isn’t the right type, and thus you send a selector that’s appropriate for class
Foo to an object of type
Bar.
The most common cause of this problem is an over release bug. Imagine this sequence:
You allocate an object of type
.FooYou put it in a dictionary.
You accidentally over release that object, freeing its memory.
Later on, you allocate an object of type
. This uses the same memory as your previous object.BarYou pull the object that’s supposed to be of type
out of your dictionary. It’s actually of typeFoo
, so when you call a method appropriate forBar
you crash like this.Foo
They changed their Optimization Level
Changing the optimisation level can mask problems like this, but it doesn’t actually fix them. A long time ago a wise developer once warned me: Bugs that mysteriously disappear will mysteriously reappear. You need to find the underlying cause of this bug.
To that end, I recommend that you apply the standard memory debugging tools. In particular, Zombies is usually good at helping track down this problem.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"