500px技术周报004

概览

1、加上ALL Exceptions断点以后每次启动都断在main函数里

加上ALL Exceptions断点以后每次启动都断在main函数里

在LLDB里面输入bt

* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.3 4.3
    frame #0: 0x000000018381be20 libc++abi.dylib`__cxa_throw
    frame #1: 0x00000001879a4cb8 libFontParser.dylib`TFileDescriptorContext::TFileDescriptorContext(char const*) + 156
    frame #2: 0x00000001879cc2e4 libFontParser.dylib`TFileDataReference::MapOrRead(char const*, int) + 40
    frame #3: 0x00000001879a4ae8 libFontParser.dylib`TFileDataReference::TFileDataReference(char const*) + 100
    frame #4: 0x00000001879a48f8 libFontParser.dylib`TFileDataSurrogate::TFileDataSurrogate(char const*, bool) + 156
    frame #5: 0x00000001879eb3ec libFontParser.dylib`TFont::CreateFontEntities(char const*, bool, bool&, short, char const*, bool) + 268
    frame #6: 0x00000001879eca40 libFontParser.dylib`TFont::CreateFontEntitiesForFile(char const*, bool, bool, short, char const*) + 220
    frame #7: 0x00000001879a4364 libFontParser.dylib`FPFontCreateFontsWithPath + 152
    frame #8: 0x0000000185d75fe4 CoreGraphics`create_private_data_array_with_path + 48
    frame #9: 0x0000000185ab9bd8 CoreGraphics`CGFontCreateFontsWithPath + 36
    frame #10: 0x0000000185b09084 CoreGraphics`CGFontCreateFontsWithURL + 372
    frame #11: 0x0000000186066fc0 GraphicsServices`AddFontsFromURLOrPath + 124
    frame #12: 0x000000018606a63c GraphicsServices`__Initialize_block_invoke + 1020
    frame #13: 0x000000010380545c libdispatch.dylib`_dispatch_client_callout + 16
    frame #14: 0x000000010380617c libdispatch.dylib`dispatch_once_f + 120
    frame #15: 0x0000000186066ae4 GraphicsServices`Initialize + 272
    frame #16: 0x000000018382d43c libobjc.A.dylib`CALLING_SOME_+initialize_METHOD + 24
    frame #17: 0x000000018382d804 libobjc.A.dylib`_class_initialize + 296
    frame #18: 0x0000000183835744 libobjc.A.dylib`lookUpImpOrForward + 228
    frame #19: 0x0000000183840758 libobjc.A.dylib`_objc_msgSend_uncached + 56
    frame #20: 0x000000018e431e54 UIKit`-[UIStatusBarForegroundStyleAttributes makeTextFontForStyle:] + 152
    frame #21: 0x000000018d7703f8 UIKit`-[UIStatusBarForegroundStyleAttributes textFontForStyle:] + 124
    frame #22: 0x000000018e43195c UIKit`-[UIStatusBarForegroundStyleAttributes imageWithText:ofItemType:forWidth:lineBreakMode:letterSpacing:textAlignment:style:withLegibilityStyle:legibilityStrength:] + 312
    frame #23: 0x000000018d770278 UIKit`-[UIStatusBarItemView imageWithText:] + 260
    frame #24: 0x000000018d7700cc UIKit`-[UIStatusBarItemView updateContentsAndWidth] + 36
    frame #25: 0x000000018d77d2f0 UIKit`-[UIStatusBarItemView initWithItem:data:actions:style:] + 432
    frame #26: 0x000000018d77d0a8 UIKit`+[UIStatusBarItemView createViewForItem:withData:actions:foregroundStyle:] + 132
    frame #27: 0x000000018d77cf2c UIKit`-[UIStatusBarLayoutManager _createViewForItem:withData:actions:] + 172
    frame #28: 0x000000018d71c5e4 UIKit`-[UIStatusBarLayoutManager _prepareEnabledItemType:withEnabledItems:withData:actions:itemAppearing:itemDisappearing:] + 332
    frame #29: 0x000000018d71c420 UIKit`-[UIStatusBarLayoutManager prepareEnabledItems:withData:actions:] + 108
    frame #30: 0x000000018d71c0d8 UIKit`-[UIStatusBarForegroundView _setStatusBarData:actions:animated:] + 544
    frame #31: 0x000000018d71bd9c UIKit`-[UIStatusBarForegroundView setStatusBarData:actions:animated:] + 1196
    frame #32: 0x000000018ddcdd20 UIKit`__51-[UIStatusBar _prepareToSetStyle:animation:forced:]_block_invoke + 356
    frame #33: 0x000000018d734a84 UIKit`+[UIView(Animation) performWithoutAnimation:] + 104
    frame #34: 0x000000018ddcd7ac UIKit`-[UIStatusBar _prepareToSetStyle:animation:forced:] + 836
    frame #35: 0x000000018ddcc748 UIKit`-[UIStatusBar _updateUIWithStyleAttributes:animationParameters:forced:] + 560
    frame #36: 0x000000018ddcc368 UIKit`-[UIStatusBar _requestStyle:animationParameters:forced:] + 520
    frame #37: 0x000000018defc430 UIKit`-[UIStatusBar_Base requestStyle:animationParameters:forced:] + 96
    frame #38: 0x000000018defc4c0 UIKit`-[UIStatusBar_Base requestStyle:animated:forced:] + 104
    frame #39: 0x000000018defbe18 UIKit`-[UIStatusBar_Base _evaluateServerRegistration] + 240
    frame #40: 0x000000018defc56c UIKit`-[UIStatusBar_Base setHidden:animationParameters:] + 92
    frame #41: 0x000000018d7946ec UIKit`-[UIStatusBar setHidden:animationParameters:] + 296
    frame #42: 0x000000018d7d0c10 UIKit`-[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] + 240
    frame #43: 0x000000018d72db4c UIKit`-[UIApplication _updateCurrentStatusBarViewControllerAppearance] + 440
    frame #44: 0x000000018d9dd7b0 UIKit`-[UIWindow _updateLayerOrderingAndSetLayerHidden:] + 616
    frame #45: 0x000000018d72a5dc UIKit`-[UIWindow _setHidden:forced:] + 228
    frame #46: 0x000000018d790e98 UIKit`-[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:] + 664
    frame #47: 0x000000018d98e430 UIKit`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1020
    frame #48: 0x000000018dc1c454 UIKit`__111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 800
    frame #49: 0x000000018deec1f0 UIKit`+[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
    frame #50: 0x000000018dc1c0b8 UIKit`-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 252
    frame #51: 0x000000018dc1c928 UIKit`-[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 748
    frame #52: 0x000000018e3856e8 UIKit`__82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 260
    frame #53: 0x000000018e38558c UIKit`-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 448
    frame #54: 0x000000018e1019c0 UIKit`__125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
    frame #55: 0x000000018e296fc8 UIKit`_performActionsWithDelayForTransitionContext + 112
    frame #56: 0x000000018e101870 UIKit`-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 252
    frame #57: 0x000000018deeb850 UIKit`-[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 364
    frame #58: 0x000000018d98ce28 UIKit`-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
    frame #59: 0x000000018dd906ec UIKit`-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364
    frame #60: 0x00000001869b9768 FrontBoardServices`-[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 364
    frame #61: 0x00000001869c2070 FrontBoardServices`__56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 224
    frame #62: 0x000000010380545c libdispatch.dylib`_dispatch_client_callout + 16
    frame #63: 0x0000000103811b74 libdispatch.dylib`_dispatch_block_invoke_direct + 268
    frame #64: 0x00000001869eda04 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
    frame #65: 0x00000001869ed6a8 FrontBoardServices`-[FBSSerialQueue _performNext] + 404
    frame #66: 0x00000001869edc44 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 56
    frame #67: 0x00000001842c0358 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #68: 0x00000001842c02d8 CoreFoundation`__CFRunLoopDoSource0 + 88
    frame #69: 0x00000001842bfb60 CoreFoundation`__CFRunLoopDoSources0 + 204
    frame #70: 0x00000001842bd738 CoreFoundation`__CFRunLoopRun + 1048
    frame #71: 0x00000001841de2d8 CoreFoundation`CFRunLoopRunSpecific + 436
    frame #72: 0x000000018606ff84 GraphicsServices`GSEventRunModal + 100
    frame #73: 0x000000018d78a880 UIKit`UIApplicationMain + 208
  * frame #74: 0x0000000100f437e8 500pxme`main(argc=1, argv=0x000000016f29f8a0) at main.m:29
    frame #75: 0x0000000183d0256c libdyld.dylib`start + 4

由上面可以看到跟字体有关。

解决办法

参考stackoverflow.com

1、在ALL Exceptions断点上面右键,在弹出框里的选择Edit breakpoint然后在Exception选择objective-C 。这样解决能避免断点,不能解决问题

2、解决问题.将所有最近修改的xib或storyboard文件中的custom字体修改成system字体。

Written on September 21, 2017