ios - My App crash on iPad before even application:didFinishLaunchingWithOptions: -
my app crashing following crashlog when ran on ipad. work fine on iphone devices. might notice, crash while trying setup window. have searched everywhere don't see such issue in other topic.
thanks help.
*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** setobjectforkey: object cannot nil (key: nsparagraphstyle)' *** first throw call stack: ( 0 corefoundation 0x000000010e38ff35 __exceptionpreprocess + 165 1 libobjc.a.dylib 0x000000010e028bb7 objc_exception_throw + 45 2 corefoundation 0x000000010e296998 -[__nsdictionarym setobject:forkey:] + 968 3 uikit 0x000000010ca99d2d -[uilabel _setlinebreakmode:] + 529 4 uikit 0x000000010cb7a572 -[uibuttonlabel setlinebreakmode:] + 93 5 uikit 0x000000010cb86e5c -[uibutton _setuptitleviewrequestinglayout:] + 308 6 uikit 0x000000010cb7ed15 -[uibutton titlelabel] + 51 7 uikit 0x000000010cd3c6d8 -[uizoomviewcontroller loadview] + 476 8 uikit 0x000000010c9f67f9 -[uiviewcontroller loadviewifrequired] + 75 9 uikit 0x000000010c9f6c8e -[uiviewcontroller view] + 27 10 uikit 0x000000010cd3bfa4 -[uizoomviewcontroller init] + 78 11 uikit 0x000000010cd39eeb -[uiclassiccontroller _setupwindow] + 544 12 uikit 0x000000010cd39b7c +[uiclassiccontroller sharedclassiccontroller] + 140 13 uikit 0x000000010c8e47dd -[uiapplication _handleapplicationactivationwithscene:transitioncontext:completion:] + 666 14 uikit 0x000000010c8e42ae __88-[uiapplication _handleapplicationlifecycleeventwithscene:transitioncontext:completion:]_block_invoke + 138 15 uikit 0x000000010c8e4215 -[uiapplication _handleapplicationlifecycleeventwithscene:transitioncontext:completion:] + 349 16 uikit 0x000000010c8cf31a -[uiapplication scene:didupdatewithdiff:transitioncontext:completion:] + 486 17 uikit 0x000000010c8cedb8 -[uiapplication workspace:didcreatescene:withtransitioncontext:completion:] + 336 18 frontboardservices 0x000000011064f612 __56-[fbsworkspace client:handlecreatescene:withcompletion:]_block_invoke_2 + 265 19 frontboardservices 0x000000011065e2a3 __31-[fbsserialqueue performasync:]_block_invoke + 16 20 corefoundation 0x000000010e2c553c __cfrunloop_is_calling_out_to_a_block__ + 12 21 corefoundation 0x000000010e2bb285 __cfrunloopdoblocks + 341 22 corefoundation 0x000000010e2bb045 __cfrunlooprun + 2389 23 corefoundation 0x000000010e2ba486 cfrunlooprunspecific + 470 24 uikit 0x000000010c8ce669 -[uiapplication _run] + 413 25 uikit 0x000000010c8d1420 uiapplicationmain + 1282 26 edyn 0x0000000109704323 main + 115 27 libdyld.dylib 0x000000010ebd2145 start + 1 28 ??? 0x0000000000000001 0x0 + 1 )
edit 1
the problem more complicated thought. here have done.
- implemented method swizzling around [uibuttonlabel setlinebreakmode:] can see causing use nil linebreakmode. found out if linebreakmode set else nslinebreakbywordwrapping crash.
- to temporary make work forcing linebreakmode nslinebreakbywordwrapping not big deal in case because label never seens in app.
edit 2
after fixing issue linebreakmode, getting same issue time [uilabel setshadow:]. note crash on label didn't change shadow attributes (color, offset or blurradius). same issue time paragraphstyle
which mean can't not keep using approach seems broken in what's happening.
edit 3
when change deployment target of app universal, don't have of above issues.
i overriding 2 functions in category , guess what? function seems called ios before control of app in appdelegate. , reason on ipad return nil. removing category fixed problem.
+ (id)systemfontofsize:(cgfloat)sz { return [uifont fontwithname:@"helveticaneue-regular" size:sz]; } + (id)boldsystemfontofsize:(cgfloat)sz { return [uifont fontwithname:@"helveticaneue-bold" size:sz]; }
Comments
Post a Comment