Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashes on registerIconFontWithURL: in iOS 10 #97

Open
vincilbishop opened this issue Oct 23, 2016 · 3 comments
Open

App Crashes on registerIconFontWithURL: in iOS 10 #97

vincilbishop opened this issue Oct 23, 2016 · 3 comments

Comments

@vincilbishop
Copy link

FAKIcon.m:16: registerIconFontWithURL: CGFontRef newFont = CGFontCreateWithDataProvider(fontDataProvider);
Crashes with little explanation. Was working fine in 9.3.2, but after upgrading to iOS 10, both older versions, and the new 2.2.0 crash on this line. The code seems to have been unchanged.

For some reason, I was able to follow the instructions in this SO post:

http://stackoverflow.com/questions/24900979/cgfontcreatewithdataprovider-hangs-in-airplane-mode

and call [UIFont familyNames]; before the registerIconFontWithURL: method was called, and the problem was solved. Weird.

@evansobkowicz
Copy link

I'm having this same issue. Wasn't able to fix it though.

@iiAtlas
Copy link

iiAtlas commented Jan 13, 2017

+1 on [UIFont familyNames], I call once in my AppDelegate and have no more issues. Bizarre.

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    //iOS 10 Random crash fix..........
    [UIFont familyNames];

    return YES;
}

@helzapps
Copy link

In order to fix this with a pod install using frameworks, the FontAwesome stuff is no longer in the mainBundle so the calls need to change from:

dispatch_once(&onceToken, ^{ [self registerIconFontWithURL: [[NSBundle mainBundle] URLForResource:@"zocial-regular-webfont" withExtension:@"ttf"]]; });

to:

dispatch_once(&onceToken, ^{ [self registerIconFontWithURL: [[NSBundle bundleForClass:[self class]] URLForResource:@"zocial-regular-webfont" withExtension:@"ttf"]]; });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants