Dzhijian / DouYuLive

仿斗鱼直播-Swift4.0,不断更新中。。。
MIT License
147 stars 28 forks source link

怎么一启动就 crash.... #5

Open woodymoo opened 4 years ago

woodymoo commented 4 years ago

怎么一启动就 crash.... 2020-09-11 17:11:08.698281+0800 DouYuLive[76044:1680462] Terminating app due to uncaught exception 'NSGenericException', reason: 'Access to UITextField's _placeholderLabel ivar is prohibited. This is an application bug' First throw call stack: ( 0 CoreFoundation 0x00007fff23e3de6e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff512a19b2 objc_exceptionthrow + 48 2 CoreFoundation 0x00007fff23e3dcac +[NSException raise:format:] + 188 3 UIKitCore 0x00007fff49686b7c -[UITextField valueForKey:] + 84 4 Foundation 0x00007fff259105ae -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 251 5 DouYuLive 0x0000000107d331b7 $s9DouYuLive16ZJHomeSearchViewC9textFieldSo06UITextH0CvgAFyXEfU + 471 6 DouYuLive 0x0000000107d32f45 $s9DouYuLive16ZJHomeSearchViewC9textFieldSo06UITextH0Cvg + 197 7 DouYuLive 0x0000000107d34098 $s9DouYuLive16ZJHomeSearchViewC010setUpChildF0yyF + 56 8 DouYuLive 0x0000000107d33fc1 $s9DouYuLive16ZJHomeSearchViewC5frameACSo6CGRectV_tcfc + 945 9 DouYuLive 0x0000000107d34056 $s9DouYuLive16ZJHomeSearchViewC5frameACSo6CGRectV_tcfcTo + 38 10 UIKitCore 0x00007fff49845c2a -[UIView init] + 44 11 DouYuLive 0x0000000107c3d6c3 $sSo6UIViewCABycfcTO + 19 12 DouYuLive 0x0000000107c3d65f $sSo6UIViewCABycfC + 31 13 DouYuLive 0x0000000107d7ac50 $s9DouYuLive20ZJBaseViewControllerC15setUpNavigationyyF + 1216 14 DouYuLive 0x0000000107d099ca $s9DouYuLive20ZJHomeViewControllerC08setUpAllE0yyF + 682 15 DouYuLive 0x0000000107d09437 $s9DouYuLive20ZJHomeViewControllerC11viewDidLoadyyF + 135 16 DouYuLive 0x0000000107d09a1b $s9DouYuLive20ZJHomeViewControllerC11viewDidLoadyyFTo + 43 17 UIKitCore 0x00007fff48cc294e -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 83 18 UIKitCore 0x00007fff48cc786c -[UIViewController loadViewIfRequired] + 1084 19 UIKitCore 0x00007fff48c2c30c -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 160 20 UIKitCore 0x00007fff48c2c60d -[UINavigationController _startTransition:fromViewController:toViewController:] + 141 21 UIKitCore 0x00007fff48c2d49b -[UINavigationController _startDeferredTransitionIfNeeded:] + 868 22 UIKitCore 0x00007fff48c2e7e0 -[UINavigationController viewWillLayoutSubviews] + 150 23 UIKitCore 0x00007fff48c0f7b0 -[UILayoutContainerView layoutSubviews] + 217 24 UIKitCore 0x00007fff4987a5f0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478 25 QuartzCore 0x00007fff2b4f9260 -[CALayer layoutSublayers] + 255 26 QuartzCore 0x00007fff2b4ff3eb _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 523 27 QuartzCore 0x00007fff2b50aa8a _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80 28 QuartzCore 0x00007fff2b453a7c _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324 29 QuartzCore 0x00007fff2b487467 _ZN2CA11Transaction6commitEv + 649 30 UIKitCore 0x00007fff4938a6bf 34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81 31 CoreFoundation 0x00007fff23da1abc CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 32 CoreFoundation 0x00007fff23da11b3 CFRunLoopDoBlocks + 195 33 CoreFoundation 0x00007fff23d9bfa3 CFRunLoopRun + 995 34 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404 35 GraphicsServices 0x00007fff38c05bbe GSEventRunModal + 139 36 UIKitCore 0x00007fff49372964 UIApplicationMain + 1605 37 DouYuLive 0x0000000107d2f4a8 main + 72 38 libdyld.dylib 0x00007fff5211c1fd start + 1 39 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Dzhijian commented 4 years ago

以解决,版本原因 ,UITextField 已经不支持kvc 修改placeholder颜色,改用attributedPlaceholder修改placeholder字体颜色