UIButton BUtton在iOS 8中使用类型崩溃应用程序

时间:2014-09-29 17:00:39

标签: exception uibutton ios8

这是一个非常奇怪的错误。我不得不将我的Xcode更新为6.0,因为iOS 8上只发生了一个错误。所以我重新编译并在iOS 8中运行应用程序以查看问题,并且应用程序在使用[UIButton buttonWithType:]初始化的任何UIButton上崩溃。

现在问题是当它停在那行代码上时没有显示错误信息,如果我按下继续,应用程序加载没有问题。天哪,我甚至可以按下有问题的按钮,它完美无缺!运行应用程序时,为什么我的异常不显示错误?为什么UIButton buttonWithType]会开始崩溃程序?

这是回溯,也许有人可以提供帮助。我调用UIButton buttonWithType之前的行只是视图的初始化器:

frame #0: 0x381fc5d0 libc++abi.dylib`__cxa_begin_catch
frame #1: 0x3177f9ac libFontParser.dylib`TFont::CreateFontEntitiesForFile(char const*, bool, TSimpleArray<TFont*>&, bool, short, char const*) + 6784
frame #2: 0x3177d9cc libFontParser.dylib`FPFontCreateFontsWithPath + 224
frame #3: 0x2b5a62d0 libCGXType.A.dylib`create_private_data_with_path + 12
frame #4: 0x2b46bfb8 CoreGraphics`CGFontCreateFontsWithPath + 24
frame #5: 0x2b4bd4e2 CoreGraphics`CGFontCreateFontsWithURL + 310
frame #6: 0x324cdf4e GraphicsServices`AddFontsFromURLOrPath + 66
frame #7: 0x324d1a3a GraphicsServices`__Initialize_block_invoke + 934
frame #8: 0x00331ad6 libdispatch.dylib`_dispatch_client_callout + 22
frame #9: 0x00332740 libdispatch.dylib`dispatch_once_f + 100
frame #10: 0x324cd7a2 GraphicsServices`Initialize + 194
frame #11: 0x388c24d8 libobjc.A.dylib`_class_initialize + 536
frame #12: 0x388c805e libobjc.A.dylib`lookUpImpOrForward + 254
frame #13: 0x388c7f56 libobjc.A.dylib`_class_lookupMethodAndLoadCache3 + 34
frame #14: 0x388ce1d8 libobjc.A.dylib`_objc_msgSend_uncached + 24
frame #15: 0x2e720b1e UIKit`-[UIButton initWithFrame:] + 506
frame #16: 0x2e721494 UIKit`+[UIButton buttonWithType:] + 692

1 个答案:

答案 0 :(得分:0)

您需要删除任何添加的自定义字体(或确保它们存在):

  1. 打开您的应用程序的plist文件,通常称为&#34; AppName-Info.plist&#34;。
  2. 仔细检查应用程序提供的&#34;字体下列出的字体&#34;存在。如果他们不这样做,请将其从plist中删除或将其添加到您的资源中(通常在名为&#34; AppNameResources&#34;在根目录下的文件夹下。
  3. enter image description here

    希望这有帮助!