Strange “Crash” with Font added to Info.plist

二次信任 提交于 2019-12-07 12:33:39

问题


I've added a custom font TTF file to an app I'm making.

I've also added the UIAppFonts key to the plist, as required.

Now, when I launch the app, it hits the "app is crashing in AppDelegate" breakpoint we all know so well.

I can't figure out a way to inspect the exception, but what's stranger is that if I play it through, the app continues just fine -- even allows me to debug. On top of that, the font in question is actually loaded, so there doesn't seem to be any issue there either. Not sure where to start looking for this one.


回答1:


Please remove the white spaces from the font file name. And change name in info.plist file. And Use the same font name which in in the .ttf file. For more information you can check NSGOD's Answer here




回答2:


The font file is probably not added to the target.




回答3:


Do you have a symbolic breakpoint set for "objc_exception_throw"? It will break on all exceptions, including the ones that will be caught by some code's try/catch frame.

Since you are seeing it show the break at UIApplicationMain, it is likely this is the closest source code to the problem. Check the stack frames in the left column to see if there are Apple internal methods being called.

Change the slider at the bottom of the left column in Xcode to show more of the stack frames if some are hidden.



来源:https://stackoverflow.com/questions/26248493/strange-crash-with-font-added-to-info-plist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!