__cxa_throw in fontWithName: size:

I have a function to get the Helvetica Neue font on iOS 8.3 (although I had the same problem with ~ 8.0).

static UIFont *helveticaNeue() { return [UIFont fontWithName:@"HelveticaNeue" size:[UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad ? 30 : 24]; } 

This function actually functions perfectly, but the first time it is called, the debugger stops, after calling this function it looks like __objc_msgSend_uncached_impcache__cxa_throw .

Judging by some other issues that I read, this exception is harmless. However, it is really annoying to hit him every time.

I tried various synonymous UIFont functions to try to get a Helvetica Neue UIFont or to do it with a class or instance method, and they all throw this exception.

I read that I can prevent this from happening by changing my All Exceptions exception point as just an Objective-C exception, however I don't want to do this because this project contains a lot of C ++ code and it looks like it would prevent exceptions in this code.

Does anyone know how to prevent an exception exception, or how to ignore only that particular exception?

+6
source share
1 answer

The problem was that my application had a structure in which the provided font was indicated in the info.plist file, which was also indicated as the provided font by the application itself (in the Fonts provided by the application). Duplicate removal resolves this issue.

0
source

Source: https://habr.com/ru/post/985922/


All Articles