NSInvalidUnarchiveOperationException?

258 views Asked by At

The current app I have been working on has been running fine with no issues and suddenly, what seems like out of the blue as I hadn't made any changes, crashes at launch with an NSInvalidUnarchiveOperationException.

I made zero code changes and the only thing I did was to run the app on my Mac to see how it would look on MacOS. I then ran it again on my iPhone and that's when the problem started to occur. I use CoreData and CloudKit so decided to delete all data to see if that would solve the issue (not thinking it would based on the console log) and it still crashes.

The console states the following:

Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (NSFontDescriptor) for key (UIFontDescriptor) because no class named "NSFontDescriptor" was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target). If the class was renamed, use setClassName:forClass: to add a class translation mapping to NSKeyedUnarchiver'

The thing is, although I use attributed strings I clearly haven't created a class named NSFontDescriptor. NSFontDescriptor is part of the SDK so I have no idea what's going on and how to fix this issue.

Any help would be much appreciated.

0

There are 0 answers