@implementation UIFont (FlatUI)
+ (void) initialize {
[super initialize];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSArray *fontNames = @[@"Lato-Regular", @"Lato-Bold", @"Lato-Italic", @"Lato-Light"];
for (NSString *fontName in fontNames) {
NSURL * url = [[NSBundle mainBundle] URLForResource:fontName withExtension:@"ttf"];
if (url) {
CFErrorRef error;
CTFontManagerRegisterFontsForURL((__bridge CFURLRef)url, kCTFontManagerScopeNone, &error);
}
}
});
}
I add exception breakpoint, and every time it gets exception at CTFontManagerRegisterFontsForURL((__bridge CFURLRef)url, kCTFontManagerScopeNone, &error);
How to solve it?
EDIT:
There might be nothing to solve. Hitting an exception breakpoint doesn't mean your app crashes. The exception might be caught internally and the app continues just fine. So the fact that you hit an exception breakpoint might not matter. The question is what happens if you continue, or if you just disable the exception breakpoint entirely. If you don't crash when the exception breakpoint is disabled, then you should just ignore the fact that you pause there when it is enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With